📄 frmpassword.frm
字号:
VERSION 5.00
Begin VB.Form frmpassword
BorderStyle = 1 'Fixed Single
Caption = "修改密码"
ClientHeight = 1440
ClientLeft = 45
ClientTop = 330
ClientWidth = 4875
ControlBox = 0 'False
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1440
ScaleWidth = 4875
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3240
TabIndex = 7
Top = 720
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 3240
TabIndex = 6
Top = 240
Width = 1335
End
Begin VB.TextBox Text3
Height = 270
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 5
Top = 840
Width = 1575
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 4
Top = 480
Width = 1575
End
Begin VB.TextBox Text1
Height = 270
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 3
Top = 120
Width = 1575
End
Begin VB.Label Label3
Caption = "确认新密码:"
Height = 255
Left = 240
TabIndex = 2
Top = 840
Width = 1095
End
Begin VB.Label Label2
Caption = "新密码:"
Height = 255
Left = 240
TabIndex = 1
Top = 480
Width = 1095
End
Begin VB.Label Label1
Caption = "旧密码:"
Height = 255
Left = 240
TabIndex = 0
Top = 120
Width = 975
End
End
Attribute VB_Name = "frmpassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rspassword As ADODB.Recordset
Private Sub Command1_Click()
If Text1.Text <> rspassword.Fields(1) Then
MsgBox "无效的旧密码 ,请重新输入"
'Text1.Text = ""
Text1.SetFocus
SendKeys "{home}+{end}"
Exit Sub
End If
If Text2.Text = Text3.Text Then
rspassword.Update
With rspassword
.Fields(1) = Text3.Text
End With
rspassword.Update
MsgBox "密码修改成功!"
Unload Me
frmmain.Visible = True
Else
MsgBox "确认的新密码有误" + Chr(13) + Chr(10) + "请重新确认新密码"
'Text3.Text =""
Text3.SetFocus
SendKeys "{home}+{end}"
End If
End Sub
Private Sub Command2_Click()
Unload Me
frmmain.Visible = True
End Sub
Private Sub Form_Load()
Set rspassword = New ADODB.Recordset
rspassword.Open " select * from userinfo where username='" + gusername + "'", cn, adOpenStatic, adLockOptimistic
End Sub
Private Sub Text1_LostFocus()
'If Text1.Text <> rspassword.Fields(1) Then
'MsgBox "无效的旧密码 ,请重新输入"
'Text1.Text = ""
'Text1.SetFocus
'End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -