📄 frm_edituser.frm
字号:
VERSION 5.00
Begin VB.Form frm_edituser
Caption = "添加用户"
ClientHeight = 3360
ClientLeft = 60
ClientTop = 450
ClientWidth = 4155
LinkTopic = "Form1"
ScaleHeight = 3360
ScaleWidth = 4155
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Fault
Caption = "取消"
Height = 375
Left = 2400
TabIndex = 8
Top = 2760
Width = 1095
End
Begin VB.CommandButton cmd_edit
Caption = "修改"
Height = 375
Left = 720
TabIndex = 7
Top = 2760
Width = 1095
End
Begin VB.Frame Frame1
Height = 2415
Left = 360
TabIndex = 0
Top = 240
Width = 3615
Begin VB.TextBox Oldpassword
Height = 285
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 9
Top = 720
Width = 1695
End
Begin VB.TextBox checkpassword
Height = 285
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 6
Top = 1560
Width = 1695
End
Begin VB.TextBox password
Height = 285
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 4
Top = 1200
Width = 1695
End
Begin VB.TextBox username
Height = 285
Left = 1560
TabIndex = 2
Top = 360
Width = 1695
End
Begin VB.Label Label4
Caption = "旧密码"
Height = 255
Left = 120
TabIndex = 10
Top = 720
Width = 1215
End
Begin VB.Label Label3
Caption = "重复密码"
Height = 255
Left = 120
TabIndex = 5
Top = 1560
Width = 1215
End
Begin VB.Label Label2
Caption = "密码"
Height = 255
Left = 120
TabIndex = 3
Top = 1200
Width = 1215
End
Begin VB.Label Label1
Caption = "用户名"
Height = 255
Left = 120
TabIndex = 1
Top = 360
Width = 1215
End
End
End
Attribute VB_Name = "frm_edituser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmd_edit_Click()
Dim strSQL As String
If password.Text <> checkpassword.Text Then
MsgBox "两次输入密码不同", vbOKOnly
password.SetFocus
Exit Sub
Else
OpenDB
strSQL = "Select * from Users where username ='" + CurrentUser + "'"
objRS.Open strSQL, objConn, adOpenDynamic, adLockOptimistic
If Oldpassword.Text <> objRS.Fields(1).Value Then
MsgBox "原密码不对", vbOKOnly
objRS.Close
CloseDB
Else
objRS.Fields(1).Value = Trim(password.Text)
objRS.Update
objRS.Close
CloseDB
MsgBox "用户密码已修改", vbOKOnly
Unload Me
End If
End If
End Sub
Private Sub fault_Click()
Unload Me
End Sub
Private Sub Form_Load()
username.Enabled = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -