📄 密码修改.frm
字号:
VERSION 5.00
Begin VB.Form mmxg
Caption = "密码修改"
ClientHeight = 3435
ClientLeft = 7635
ClientTop = 4230
ClientWidth = 4080
LinkTopic = "Form1"
ScaleHeight = 3435
ScaleWidth = 4080
Begin VB.TextBox Text2
Height = 375
Left = 1800
TabIndex = 8
Top = 2040
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2040
TabIndex = 7
Top = 2760
Width = 975
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 600
TabIndex = 6
Top = 2760
Width = 975
End
Begin VB.TextBox Text1
Height = 375
Index = 2
Left = 1800
TabIndex = 5
Top = 1440
Width = 1335
End
Begin VB.TextBox Text1
Height = 375
Index = 1
Left = 1800
TabIndex = 4
Top = 840
Width = 1335
End
Begin VB.TextBox Text1
Height = 375
Index = 0
Left = 1800
TabIndex = 3
Top = 240
Width = 1335
End
Begin VB.Label Label4
Caption = "确认新密码"
Height = 375
Left = 480
TabIndex = 9
Top = 2040
Width = 975
End
Begin VB.Label Label3
Caption = "新密码"
Height = 375
Left = 480
TabIndex = 2
Top = 1440
Width = 975
End
Begin VB.Label Label2
Caption = "原密码"
Height = 375
Left = 480
TabIndex = 1
Top = 840
Width = 975
End
Begin VB.Label Label1
Caption = "登陆名"
Height = 375
Left = 480
TabIndex = 0
Top = 240
Width = 975
End
End
Attribute VB_Name = "mmxg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Text1_GotFocus(Index As Integer)
text1(Index).SelStart = 0
text1(Index).SelLength = Len(text1(Index))
End Sub
Private Sub Text1_LostFocus(Index As Integer)
text1(Index).BackColor = &HFFFFFF
End Sub
Private Sub text1_keydown(Index As Integer, keycode As Integer, shift As Integer)
If keycode = vbKeyReturn And Index < 2 Then text1(Index + 1).SetFocus
If keycode = vbKeyReturn And Index = 2 Then Command1.SetFocus
If keycode = vbKeyUp And Index > 0 Then text1(Index - 1).SetFocus
End Sub
Private Sub Command1_Click()
Dim rs1 As New ADODB.Recordset
If Len(text1(0)) = 0 Then
MsgBox "请输入登陆名!", , "提示"
Exit Sub
End If
If Len(text1(1)) = 0 Then
MsgBox "请输入原密码!", , "提示"
Exit Sub
End If
On Error GoTo SaveErr
rs1.Open "登陆表 where 登陆名 ='" + text1(0).Text + "'", Cnn, adOpenStatic
If rs1.RecordCount > 0 Then
If text1(1) <> rs1.Fields("密码") Then
MsgBox "原密码不正确!", , "提示"
text1(1).SetFocus
Else
If Len(text1(2)) = 0 Then
MsgBox "请输入新密码!", , "提示"
text1(2).SetFocus
Else
If Text2.Text = text1(2).Text Then
Cnn.Execute ("update 登陆表 set 密码='" + text1(2) + "'where 登陆名='" + text1(0).Text + "'")
MsgBox "密码修改成功!", , "提示"
Command2_Click
Else: MsgBox "两次密码输入不一至", , "提示"
text1(2).SetFocus
End If
End If
End If
Else
MsgBox "用户名不正确!", , "提示"
text1(0).SetFocus
End If
Exit Sub
SaveErr:
MsgBox Err.Description
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -