?? form9.frm
字號(hào):
VERSION 5.00
Begin VB.Form Form9
Caption = "Form9"
ClientHeight = 6090
ClientLeft = 60
ClientTop = 450
ClientWidth = 11505
LinkTopic = "Form9"
MDIChild = -1 'True
ScaleHeight = 6090
ScaleWidth = 11505
Begin VB.CommandButton Command1
Caption = "確定"
Height = 375
Left = 7080
TabIndex = 26
Top = 5280
Width = 1695
End
Begin VB.Frame Frame1
Caption = "添加管理員"
Height = 4935
Left = 120
TabIndex = 0
Top = 120
Width = 8655
Begin VB.Frame Frame2
Caption = "說(shuō)明"
Height = 1575
Left = 5520
TabIndex = 24
Top = 3000
Width = 2655
Begin VB.Label Label14
Caption = "*為必填項(xiàng)"
Height = 855
Left = 120
TabIndex = 25
Top = 360
Width = 2415
End
End
Begin VB.OptionButton Option3
Caption = "借閱管理"
Height = 255
Left = 5520
TabIndex = 23
Top = 1800
Width = 1095
End
Begin VB.OptionButton Option2
Caption = "書(shū)籍管理"
Height = 255
Left = 5520
TabIndex = 22
Top = 1200
Width = 1215
End
Begin VB.OptionButton Option1
Caption = "系統(tǒng)管理"
Height = 255
Left = 5520
TabIndex = 21
Top = 600
Value = -1 'True
Width = 1215
End
Begin VB.TextBox Text4
Height = 270
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 16
Top = 1800
Width = 1695
End
Begin VB.TextBox Text3
Height = 270
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 15
Top = 1200
Width = 1695
End
Begin VB.TextBox TxtDiZhi
Height = 255
Left = 1320
TabIndex = 5
Top = 4320
Width = 2775
End
Begin VB.TextBox TxtDanWei
Height = 255
Left = 1320
TabIndex = 4
Top = 3720
Width = 2775
End
Begin VB.TextBox TxtName
Height = 270
Left = 1320
TabIndex = 3
Top = 2400
Width = 1695
End
Begin VB.TextBox TxtDianHua
Height = 255
Left = 1320
TabIndex = 2
Top = 3120
Width = 2775
End
Begin VB.TextBox Text1
Height = 270
Left = 1320
TabIndex = 1
Top = 600
Width = 1695
End
Begin VB.Label Label13
Caption = "*"
Height = 255
Left = 120
TabIndex = 20
Top = 1920
Width = 255
End
Begin VB.Label Label12
Caption = "*"
Height = 255
Left = 120
TabIndex = 19
Top = 1320
Width = 255
End
Begin VB.Label Label11
Caption = "重復(fù)密碼:"
Height = 255
Left = 360
TabIndex = 18
Top = 1920
Width = 975
End
Begin VB.Label Label10
Caption = "密碼:"
Height = 255
Left = 720
TabIndex = 17
Top = 1320
Width = 735
End
Begin VB.Label Label9
Caption = "*"
Height = 255
Left = 120
TabIndex = 14
Top = 2520
Width = 255
End
Begin VB.Label Label8
Caption = "*"
Height = 255
Left = 4560
TabIndex = 13
Top = 600
Width = 135
End
Begin VB.Label Label2
Caption = "*"
Height = 255
Left = 120
TabIndex = 12
Top = 720
Width = 255
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "地址:"
Height = 180
Left = 720
TabIndex = 11
Top = 4440
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "單位:"
Height = 180
Left = 720
TabIndex = 10
Top = 3840
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "姓名:"
Height = 180
Left = 720
TabIndex = 9
Top = 2520
Width = 540
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "電話:"
Height = 180
Left = 720
TabIndex = 8
Top = 3240
Width = 540
End
Begin VB.Label Label5
Caption = "ID:"
Height = 255
Left = 840
TabIndex = 7
Top = 720
Width = 495
End
Begin VB.Label Label7
Caption = "等級(jí):"
Height = 255
Left = 4800
TabIndex = 6
Top = 600
Width = 735
End
End
End
Attribute VB_Name = "Form9"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "ID", vbOKOnly, "提示": Exit Sub
End If
If Text3.Text = "" Then
MsgBox "密碼", vbOKOnly, "提示": Exit Sub
End If
If TxtName.Text = "" Then
MsgBox "姓名", vbOKOnly, "提示": Exit Sub
End If
If Text3.Text <> Text4.Text Then
MsgBox "兩次密碼輸入不同", vbOKOnly, "提示": Exit Sub
End If
With rsgly
If .State = adStateOpen Then .Close
.Open "select * from 管理員 where ID ='" + Text1.Text + "'", cn, adOpenKeyset, adLockOptimistic, 1
If .RecordCount > 0 Then
MsgBox "此ID已存在!", vbOKOnly, "提示"
Else
.AddNew
.Fields("ID") = Text1.Text
.Fields("密碼") = Text3.Text
.Fields("姓名") = TxtName.Text
.Fields("電話") = TxtDianHua.Text
.Fields("單位") = TxtDanWei.Text
.Fields("地址") = TxtDiZhi.Text
If Option1 Then
.Fields("等級(jí)") = "系統(tǒng)管理"
ElseIf Option2 Then
.Fields("等級(jí)") = "書(shū)籍管理"
Else
.Fields("等級(jí)") = "借閱管理"
End If
.Update
MsgBox "添加成功!", vbOKOnly, "提示"
Text1.Text = ""
Text3.Text = ""
TxtName.Text = ""
TxtDianHua.Text = ""
TxtDanWei.Text = ""
TxtDiZhi.Text = ""
End If
End With
End Sub
Private Sub Command3_Click()
If rsbook.State = adStateOpen Then rsbook.Close
If Text1.Text <> "" Then
rsbook.Open "select * from 書(shū)籍 where 書(shū)籍編號(hào)='" + Text1.Text + "'", cn, adOpenKeyset, adLockOptimistic
rsbook.Fields("書(shū)籍編號(hào)") = Text1.Text
Else: Exit Sub
End If
If Text4.Text <> "" Then
rsbook.Fields("類別") = Text4.Text
Else: MsgBox "請(qǐng)輸入類別", vbOKOnly, "提示"
Exit Sub
End If
If Text2.Text <> "" Then
rsbook.Fields("名稱") = Text2.Text
Else: MsgBox "請(qǐng)輸入名稱", vbOKOnly, "提示"
Exit Sub
End If
If TxtDingJia.Text <> "" Then
rsbook.Fields("定價(jià)") = Int(Val(TxtDingJia.Text))
Else: MsgBox "請(qǐng)輸入類定價(jià)", vbOKOnly, "提示"
Exit Sub
End If
If Text6.Text <> "" Then
rsbook.Fields("數(shù)量") = Val(Text6.Text)
Else: MsgBox "請(qǐng)輸入數(shù)量", vbOKOnly, "提示"
Exit Sub
End If
If Text7.Text <> "" Then
rsbook.Fields("狀態(tài)") = Val(Text7.Text)
Else: MsgBox "請(qǐng)輸入狀態(tài)", vbOKOnly, "提示"
Exit Sub
End If
rsbook.Fields("出版社") = Text5.Text
rsbook.Fields("作者") = Text3.Text
rsbook.Fields("出版日期") = TxtChuBanRQ.Text
rsbook.Fields("簡(jiǎn)介") = TxtJianJie.Text
rsbook.Update
MsgBox "修改成功!", vbOKOnly, "提示"
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -