📄 frmupdatepw.frm
字号:
VERSION 5.00
Begin VB.Form frmUpdatePW
BackColor = &H00404040&
BorderStyle = 1 'Fixed Single
Caption = "修改密码"
ClientHeight = 2010
ClientLeft = 45
ClientTop = 435
ClientWidth = 7935
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 2010
ScaleWidth = 7935
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取 消"
Height = 345
Left = 6720
TabIndex = 5
Top = 1080
Width = 975
End
Begin VB.CommandButton cmdOK
Caption = "确 定"
Default = -1 'True
Height = 345
Left = 6720
TabIndex = 4
Top = 480
Width = 975
End
Begin VB.TextBox txt
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
IMEMode = 3 'DISABLE
Index = 2
Left = 1800
PasswordChar = "*"
TabIndex = 3
Top = 1320
Width = 3975
End
Begin VB.TextBox txt
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
IMEMode = 3 'DISABLE
Index = 1
Left = 1800
PasswordChar = "*"
TabIndex = 2
Top = 840
Width = 3975
End
Begin VB.TextBox txt
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
IMEMode = 3 'DISABLE
Index = 0
Left = 1800
PasswordChar = "*"
TabIndex = 1
Top = 360
Width = 3975
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请确认你的新密码:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 2
Left = 120
TabIndex = 7
Top = 1440
Width = 1620
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请输入你的新密码:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 1
Left = 120
TabIndex = 6
Top = 960
Width = 1620
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请输入你的旧密码:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 0
Left = 120
TabIndex = 0
Top = 480
Width = 1620
End
End
Attribute VB_Name = "frmUpdatePW"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rst As Recordset
'响应 "关闭" 按钮
Private Sub cmdCancel_Click()
Unload Me
End Sub
'响应 "确定" 按钮
Private Sub cmdOK_Click()
Set rst = New Recordset
Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
con.Open
rst.Open "select password from users where name='" & userName & "'", con, adOpenDynamic, adLockOptimistic
If rst!password <> txt(0).Text Then
MsgBox "旧密码不对,请重新输入!"
Exit Sub
End If
If txt(1).Text <> txt(2).Text Then
MsgBox "两次输入的密码不同,请重新输入!"
Exit Sub
End If
If Len(txt(1).Text) > 12 Then
MsgBox "密码长度不得大于12位!"
Exit Sub
End If
rst.Close
con.Execute "update users set password='" & txt(1).Text & "' where name='" & userName & "'"
con.Close
MsgBox "密码更新成功!"
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -