📄 xgmm.frm
字号:
VERSION 5.00
Begin VB.Form xgmm
BackColor = &H00FFC0C0&
Caption = "修改密码"
ClientHeight = 3060
ClientLeft = 60
ClientTop = 450
ClientWidth = 4110
LinkTopic = "Form2"
ScaleHeight = 3060
ScaleWidth = 4110
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Cmd_OK
BackColor = &H00FF0000&
Caption = "确认"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 720
TabIndex = 8
Top = 2280
Width = 1000
End
Begin VB.CommandButton Cmd_Cancel
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 2520
TabIndex = 7
Top = 2280
Width = 1000
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Height = 1935
Left = 360
TabIndex = 0
Top = 0
Width = 3615
Begin VB.TextBox txt_SurePwd
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 3
Top = 1440
Width = 2175
End
Begin VB.TextBox txt_NewPwd
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 2
Top = 840
Width = 2175
End
Begin VB.TextBox txt_OldPwd
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 1
Top = 240
Width = 2175
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "确认口令:"
Height = 180
Left = 360
TabIndex = 6
Top = 1560
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "新口令:"
Height = 180
Left = 480
TabIndex = 5
Top = 960
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "旧口令:"
Height = 180
Left = 480
TabIndex = 4
Top = 360
Width = 720
End
End
End
Attribute VB_Name = "xgmm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
Dim username As String
username = Right(MDIForm1.StatusBar1.Panels(1).Text, Len(MDIForm1.StatusBar1.Panels(1).Text) - 5)
Set rpwd = New Recordset
rpwd.Open "select * from 用户表 where [user]='" & username & "' and pwd ='" & txt_OldPwd.Text & "'", cs, adOpenKeyset, adLockPessimistic
If rpwd.RecordCount = 0 Then
MsgBox "旧口令不正确,您无权修改密码!", vbInformation, "错误"
Else
If txt_NewPwd.Text = txt_SurePwd.Text Then
cs.Execute "update 用户表 set pwd='" & txt_SurePwd.Text & "' where user='" & username & "'"
MsgBox "口令修改成功!", vbInformation, "成功"
Cmd_Cancel_Click
Else
MsgBox "确认口令不正确!", vbInformation, "错误"
txt_SurePwd.Text = ""
txt_SurePwd.SetFocus
End If
End If
End Sub
Private Sub Form_Load()
Call LoginAccess
End Sub
Private Sub txt_NewPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txt_SurePwd.SetFocus
End Sub
Private Sub txt_OldPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then txt_NewPwd.SetFocus
End Sub
Private Sub txt_SurePwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Cmd_OK.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -