📄 frmmodifypassword.frm
字号:
VERSION 5.00
Begin VB.Form frmModifyPassword
Caption = "修改密码"
ClientHeight = 3315
ClientLeft = 3615
ClientTop = 2415
ClientWidth = 4680
Icon = "frmModifyPassword.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3315
ScaleWidth = 4680
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 495
Left = 2753
TabIndex = 7
Top = 2640
Width = 1335
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 495
Left = 593
TabIndex = 6
Top = 2640
Width = 1335
End
Begin VB.TextBox txtConfirm
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 5
Top = 1920
Width = 2295
End
Begin VB.TextBox txtPassword
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 2
Top = 1080
Width = 2295
End
Begin VB.TextBox txtName
Enabled = 0 'False
Height = 375
Left = 1800
TabIndex = 0
Top = 240
Width = 2295
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "人员姓名(&N):"
Height = 180
Left = 360
TabIndex = 4
Top = 330
Width = 1080
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "确认密码(&C):"
Height = 180
Left = 360
TabIndex = 3
Top = 2010
Width = 1080
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "输入密码(&P):"
Height = 180
Left = 360
TabIndex = 1
Top = 1170
Width = 1080
End
End
Attribute VB_Name = "frmModifyPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim ws As Workspace, db As Database, rs As Recordset
Dim strPassword As String * 20, strPasswordConfirm As String * 20
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
'处理密码文本框
If txtPassword.Text = "" Or txtConfirm.Text = "" Then
MsgBox "请输入密码!", vbExclamation + vbOKOnly, "修改密码"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
Exit Sub
End If
strPassword = txtPassword.Text
strPasswordConfirm = txtConfirm.Text
If strPassword <> strPasswordConfirm Then
MsgBox "确认密码不对!", vbExclamation + vbOKOnly, "修改密码"
txtConfirm.SetFocus
SendKeys "{Home}+{End}"
Exit Sub
End If
'向数据库中写入密码
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(App.Path + "\权限表.mdb", False, False)
Set rs = db.OpenRecordset("权限表")
rs.MoveFirst
rs.Move OperatorNum - 1
rs.Edit
rs.Fields("密码") = Trim(strPassword)
rs.Update
'关闭数据库
rs.Close
db.Close
ws.Close
Set rs = Nothing
Set db = Nothing
Set ws = Nothing
MsgBox "修改密码成功!", vbInformation + vbOKOnly, "修改密码"
Unload Me
End Sub
Private Sub Form_Load()
txtName.Text = OperatorName2
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -