📄 frmadduser.frm
字号:
VERSION 5.00
Begin VB.Form FrmAddUser
Caption = "添加管理员"
ClientHeight = 2775
ClientLeft = 60
ClientTop = 345
ClientWidth = 3855
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2775
ScaleWidth = 3855
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Height = 2760
Left = 0
TabIndex = 0
Top = -45
Width = 3840
Begin VB.CommandButton Command1
Caption = "取消"
Height = 420
Index = 1
Left = 2610
TabIndex = 5
Top = 2205
Width = 1050
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 420
Index = 0
Left = 1350
TabIndex = 4
Top = 2205
Width = 1050
End
Begin VB.TextBox Text1
Height = 330
IMEMode = 3 'DISABLE
Index = 2
Left = 1305
PasswordChar = "*"
TabIndex = 3
Top = 1530
Width = 1905
End
Begin VB.TextBox Text1
Height = 330
IMEMode = 3 'DISABLE
Index = 1
Left = 1305
PasswordChar = "*"
TabIndex = 2
Top = 990
Width = 1905
End
Begin VB.TextBox Text1
Height = 330
Index = 0
Left = 1305
TabIndex = 1
Top = 450
Width = 1905
End
Begin VB.Label Label1
Caption = "确认密码:"
Height = 285
Index = 2
Left = 360
TabIndex = 8
Top = 1575
Width = 1005
End
Begin VB.Label Label1
Caption = "密码:"
Height = 285
Index = 1
Left = 405
TabIndex = 7
Top = 1035
Width = 1005
End
Begin VB.Label Label1
Caption = "用户名:"
Height = 285
Index = 0
Left = 405
TabIndex = 6
Top = 495
Width = 1005
End
End
End
Attribute VB_Name = "FrmAddUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Rs As ADODB.Recordset
Private Sub Command1_Click(Index As Integer)
Dim Msg$
Dim SQL$
Select Case Index
Case 0
If Text1(0).Text = Empty Then
MsgBox "请输入用户名", vbInformation, "操作失败"
Text1(0).SetFocus
Exit Sub
End If
If Text1(1).Text = Empty Then
MsgBox "请输入用户密码", vbInformation, "操作失败"
Text1(1).SetFocus
Exit Sub
End If
If Text1(2).Text = Empty Then
MsgBox "请输入确认密码", vbInformation, "操作失败"
Text1(2).SetFocus
Exit Sub
End If
If Text1(1).Text <> Text1(2).Text Then
MsgBox "密码与确认密码不一致,请重新输入密码", vbInformation, "操作失败"
Exit Sub
End If
DBName = UserDB
SQL = "select * from UserInfo where UserName='" & Text1(0).Text & "'"
Set Rs = executeSQL(SQL, Msg, DBName)
If Msg = "查询正确" Then
MsgBox "用户已存在请重新输入用户名", vbInformation, "操作失败"
Set Rs = Nothing
Else
Rs.AddNew
Rs.Fields(0) = Text1(0).Text
Rs.Fields(1) = JiaMi(Text1(1).Text, Text1(0).Text)
Rs.Fields(2) = "1"
Rs.Update
MsgBox "用户添加成功!", vbInformation, "提示"
Set Rs = Nothing
Unload Me
End If
Case 1
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -