📄 frmadduser.frm
字号:
VERSION 5.00
Begin VB.Form frmAdduser
BorderStyle = 1 'Fixed Single
Caption = "添加用户"
ClientHeight = 2535
ClientLeft = 45
ClientTop = 330
ClientWidth = 4245
Icon = "frmAdduser.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2535
ScaleWidth = 4245
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton CmdCancel
Caption = "取 消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2160
TabIndex = 7
Top = 1920
Width = 1215
End
Begin VB.CommandButton CmdOK
Caption = "确 定"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 6
Top = 1920
Width = 1215
End
Begin VB.TextBox confirmPWD
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 2
Top = 1320
Width = 1935
End
Begin VB.TextBox UserPWD
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 1
Top = 720
Width = 1935
End
Begin VB.TextBox UserName
Height = 375
Left = 1560
TabIndex = 0
Top = 240
Width = 1935
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "确认新密码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 2
Left = 360
TabIndex = 5
Top = 1440
Width = 1260
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "新用户密码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 1
Left = 360
TabIndex = 4
Top = 840
Width = 1260
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "新用户名称:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 0
Left = 360
TabIndex = 3
Top = 360
Width = 1260
End
End
Attribute VB_Name = "frmAdduser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'添加用户称与密码
Private Sub CmdCancel_Click()
Unload Me
End Sub
Private Sub CmdOK_Click()
If Trim(UserName.Text) = "" Then '判断是否输入用户名称?
MsgBox "请输入用户名称", vbOKOnly + vbExclamation, "警告"
Exit Sub
UserName.SetFocus
Else
SQL = "select * from userInfo where UserID='" & UserName & "'"
' If rs.State Then rs.Close
Set rs = TransactSQL(SQL)
If rs.EOF = False Then '判断此用户名称是否已经存在?
MsgBox "这个用户已经存在,请重新输入新用户名!", vbOKOnly + vbExclamation, "警告"
UserName.SetFocus
UserName.Text = ""
UserPWD.Text = ""
confirmPWD.Text = ""
Exit Sub
Else
If Trim(UserPWD.Text) <> Trim(confirmPWD.Text) Then '判断两次输入密码是否相同?
MsgBox "两次密码输入不一致,请重新输入!", vbOKOnly + vbExclamation, "警告"
UserPWD.Text = ""
confirmPWD.Text = ""
UserPWD.SetFocus
Exit Sub
ElseIf Trim(UserPWD.Text) = "" Then
MsgBox "密码不能为空", vbOKOnly + vbExclamation, "警告"
UserPWD.Text = ""
confirmPWD.Text = ""
UserPWD.SetFocus
Else
SQL = "insert into UserInfo(UserID,UserPWD)values('" & UserName & "','" & UserPWD & "')"
Call TransactSQL(SQL)
MsgBox "添加成功", vbOKOnly + vbExclamation, "添加结果"
UserName.Text = ""
UserPWD.Text = ""
confirmPWD.Text = ""
End If
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -