📄 frmadduser.frm
字号:
VERSION 5.00
Begin VB.Form frmAddUser
BorderStyle = 1 'Fixed Single
Caption = "添加用户"
ClientHeight = 3660
ClientLeft = 45
ClientTop = 330
ClientWidth = 5880
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3660
ScaleWidth = 5880
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 495
Left = 3120
TabIndex = 7
Top = 2760
Width = 1095
End
Begin VB.CommandButton cmdAdd
Caption = "确定"
Height = 495
Left = 480
TabIndex = 6
Top = 2760
Width = 1095
End
Begin VB.TextBox txtConfirm
Height = 495
Left = 1680
TabIndex = 5
Top = 1920
Width = 2655
End
Begin VB.TextBox txtPassword
Height = 495
Left = 1680
TabIndex = 4
Top = 1080
Width = 2655
End
Begin VB.TextBox txtUserName
Height = 495
Left = 1680
TabIndex = 3
Top = 240
Width = 2655
End
Begin VB.Label Label3
Caption = "请确认密码"
Height = 375
Left = 120
TabIndex = 2
Top = 2040
Width = 1215
End
Begin VB.Label Label2
Caption = "请输入密码"
Height = 375
Left = 120
TabIndex = 1
Top = 1080
Width = 1215
End
Begin VB.Label Label1
Caption = "请输入用户名"
Height = 375
Left = 120
TabIndex = 0
Top = 360
Width = 1215
End
End
Attribute VB_Name = "frmAddUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs_addUser As New ADODB.Recordset
Private Sub cmdadd_Click()
If txtPassword.Text <> txtConfirm.Text Then
MsgBox "密码输入不一致", vbOKOnly + vbExclamation, "提示"
txtPassword.SetFocus
Exit Sub
End If
Dim sqlfc As String
sqlfc = "select * from userdb"
rs_addUser.Open sqlfc, conn, adOpenKeyset, adLockPessimistic
rs_addUser.AddNew
rs_addUser.Fields(1) = txtUserName.Text
rs_addUser.Fields(2) = txtPassword.Text
rs_addUser.Update
MsgBox "添加用户成功", vbOKOnly + vbExclamation, ""
rs_addUser.Close
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub Form_Load()
'让窗体居中
Call MakeCenter(Me)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -