📄 pasmodify.frm
字号:
VERSION 5.00
Begin VB.Form PasModify
BackColor = &H00FF8080&
Caption = "修改密码"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Cancel
Caption = "取消"
Height = 495
Left = 2640
TabIndex = 7
Top = 1920
Width = 1215
End
Begin VB.CommandButton Modify
Caption = "修改"
Height = 495
Left = 840
TabIndex = 6
Top = 1920
Width = 1215
End
Begin VB.TextBox NewPas2
Height = 375
Left = 1320
TabIndex = 5
Top = 1320
Width = 2415
End
Begin VB.TextBox NewPas1
Height = 375
Left = 1320
TabIndex = 4
Top = 720
Width = 2415
End
Begin VB.TextBox OldPas
Height = 375
Left = 1320
TabIndex = 3
Top = 120
Width = 2415
End
Begin VB.Label Label3
Caption = "验证:"
Height = 255
Left = 480
TabIndex = 2
Top = 1440
Width = 735
End
Begin VB.Label Label2
Caption = "新密码:"
Height = 255
Left = 360
TabIndex = 1
Top = 840
Width = 735
End
Begin VB.Label Label1
Caption = "原密码:"
Height = 255
Left = 360
TabIndex = 0
Top = 240
Width = 735
End
End
Attribute VB_Name = "PasModify"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cancel_Click()
Unload Me
End Sub
Private Sub Modify_Click()
If OldPas.Text <> UserPas Then
MsgBox "原密码错误!"
Exit Sub
End If
If NewPas1.Text <> NewPas2.Text Then
MsgBox "两次密码不一致!"
Exit Sub
End If
On Error Resume Next
Dim fit As String
'查找用户名
fit = "用户名='"
fit = fit + UserName + "'"
frmLogin.Data2.Recordset.FindFirst fit
'找不到该用户
If frmLogin.Data2.Recordset.NoMatch Then
Exit Sub
Else
UserPas = NewPas1.Text
'设置新密码
frmLogin.Data2.Recordset.Edit
frmLogin.Data2.Recordset.Fields("用户密码").Value = UserPas
frmLogin.Data2.Recordset.update
MsgBox "修改成功!"
End If
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -