📄 form9.frm
字号:
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 = "说明"
Height = 1575
Left = 5520
TabIndex = 24
Top = 3000
Width = 2655
Begin VB.Label Label14
Caption = "*为必填项"
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 = "书籍管理"
Height = 255
Left = 5520
TabIndex = 22
Top = 1200
Width = 1215
End
Begin VB.OptionButton Option1
Caption = "系统管理"
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 = "重复密码:"
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 = "等级:"
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("等级") = "系统管理"
ElseIf Option2 Then
.Fields("等级") = "书籍管理"
Else
.Fields("等级") = "借阅管理"
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 书籍 where 书籍编号='" + Text1.Text + "'", cn, adOpenKeyset, adLockOptimistic
rsbook.Fields("书籍编号") = Text1.Text
Else: Exit Sub
End If
If Text4.Text <> "" Then
rsbook.Fields("类别") = Text4.Text
Else: MsgBox "请输入类别", vbOKOnly, "提示"
Exit Sub
End If
If Text2.Text <> "" Then
rsbook.Fields("名称") = Text2.Text
Else: MsgBox "请输入名称", vbOKOnly, "提示"
Exit Sub
End If
If TxtDingJia.Text <> "" Then
rsbook.Fields("定价") = Int(Val(TxtDingJia.Text))
Else: MsgBox "请输入类定价", vbOKOnly, "提示"
Exit Sub
End If
If Text6.Text <> "" Then
rsbook.Fields("数量") = Val(Text6.Text)
Else: MsgBox "请输入数量", vbOKOnly, "提示"
Exit Sub
End If
If Text7.Text <> "" Then
rsbook.Fields("状态") = Val(Text7.Text)
Else: MsgBox "请输入状态", vbOKOnly, "提示"
Exit Sub
End If
rsbook.Fields("出版社") = Text5.Text
rsbook.Fields("作者") = Text3.Text
rsbook.Fields("出版日期") = TxtChuBanRQ.Text
rsbook.Fields("简介") = TxtJianJie.Text
rsbook.Update
MsgBox "修改成功!", vbOKOnly, "提示"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -