📄 form10.frm
字号:
VERSION 5.00
Begin VB.Form Form10
Caption = "管理员密码修改"
ClientHeight = 3705
ClientLeft = 60
ClientTop = 450
ClientWidth = 5865
LinkTopic = "Form10"
ScaleHeight = 3705
ScaleWidth = 5865
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 3360
TabIndex = 5
Top = 2880
Width = 1455
End
Begin VB.Frame Frame1
Caption = "修改密码"
Height = 2415
Left = 360
TabIndex = 0
Top = 240
Width = 4455
Begin VB.TextBox Text4
Height = 270
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 9
Top = 1920
Width = 2295
End
Begin VB.TextBox Text3
Height = 270
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 8
Top = 1440
Width = 2295
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 7
Top = 960
Width = 2295
End
Begin VB.TextBox Text1
Height = 270
Left = 1680
TabIndex = 6
Top = 480
Width = 2295
End
Begin VB.Label Label4
Caption = "重复新密码"
Height = 255
Left = 360
TabIndex = 4
Top = 1920
Width = 1095
End
Begin VB.Label Label3
Caption = "新密码"
Height = 375
Left = 360
TabIndex = 3
Top = 1440
Width = 615
End
Begin VB.Label Label2
Caption = "原始密码"
Height = 255
Left = 360
TabIndex = 2
Top = 960
Width = 735
End
Begin VB.Label Label1
Caption = "ID"
Height = 255
Left = 360
TabIndex = 1
Top = 480
Width = 255
End
End
End
Attribute VB_Name = "Form10"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If rsgly.State = adStateOpen Then rsgly.Close
If Text1.Text = "" Then MsgBox "ID", vbOKOnly, "提示": Exit Sub
If Text2.Text = "" Then MsgBox "原密码", vbOKOnly, "提示": Exit Sub
If Text3.Text = "" Then MsgBox "新密码", vbOKOnly, "提示": Exit Sub
If Text4.Text = "" Then MsgBox "重复新密码!", vbOKOnly, "提示": Exit Sub
If Text3.Text <> Text4.Text Then MsgBox "两次输入新密码不同,请确认!", vbOKOnly, "提示": Exit Sub
rsgly.Open "select * from 管理员 where ID='" + Text1.Text + "'", cn, adOpenKeyset, adLockOptimistic
If rsgly.RecordCount = 0 Then
MsgBox "无此ID,请点信息确认.", vbOKOnly, "提示信息"
Text1.SetFocus
SendKeys "{Home}+{End}": Exit Sub
rsgly.Open "select 原始密码 from 管理员 where ID='" + Text1.Text + "'", cn, adOpenKeyset, adLockOptimistic
End If
If rsgly.Fields("ID") <> Text1.Text Then
MsgBox "原始密码错误.", vbOKOnly, "提示信息"
Text2.SetFocus
SendKeys "{Home}+{End}": Exit Sub
rsgly.Fields("ID") = Text1.Text
rsgly.Fields("密码") = Text3.Text
rsgly.Update
MsgBox "操作成功!", vbOKOnly, "提示"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -