📄 frmchangempw.frm
字号:
VERSION 5.00
Begin VB.Form frmChangeMpw
Caption = "管理员密码修改"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 495
Left = 2160
TabIndex = 6
Top = 2280
Width = 975
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Height = 495
Left = 720
TabIndex = 5
Top = 2280
Width = 975
End
Begin VB.Frame Frame1
Caption = "请输入"
Height = 1695
Left = 480
TabIndex = 0
Top = 120
Width = 3615
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 4
Top = 1080
Width = 1935
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 2
Top = 360
Width = 1935
End
Begin VB.Label Label2
Caption = "请重新输入新密码"
Height = 495
Left = 240
TabIndex = 3
Top = 1080
Width = 855
End
Begin VB.Label Label1
Caption = "新密码"
Height = 375
Left = 360
TabIndex = 1
Top = 360
Width = 735
End
End
End
Attribute VB_Name = "frmChangeMpw"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'定义成函数,返回是修改证成功
Private Function SaveManageInfo() As Boolean
Dim RS
'先判断再打开数据库,避免资源浪费
SaveManageInfo = (Text1 = Text2)
If (Text1 <> Text2) Then
MsgBox "两次密码不相同,请重新输入!", vbOKOnly Or vbInformation, "修改管理员密码"
Text1.SetFocus 'setfocus是控件的一个方法
Text1 = ""
Text2 = ""
Else
Set RS = CreateObject("ADODB.RecordSet")
StrSQL = "select * from manager where username = '" & LogonUser & "'"
RS.Open StrSQL, ConnStr, 1, 3
RS("password") = Text1
RS.Update
RS.Close
Set RS = Nothing
Unload Me
End If
End Function
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
If SaveManageInfo Then Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -