📄 更改密码.frm
字号:
VERSION 5.00
Begin VB.Form Form11
Caption = "更改密码"
ClientHeight = 2385
ClientLeft = 60
ClientTop = 450
ClientWidth = 3825
LinkTopic = "Form1"
ScaleHeight = 2385
ScaleWidth = 3825
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 1920
TabIndex = 5
Top = 1800
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 480
TabIndex = 4
Top = 1800
Width = 1095
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 3
Top = 1200
Width = 1695
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 1
Top = 480
Width = 1695
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "再次输入密码"
Height = 375
Left = 360
TabIndex = 2
Top = 1200
Width = 1335
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "输入新密码"
Height = 375
Left = 360
TabIndex = 0
Top = 480
Width = 1335
End
End
Attribute VB_Name = "Form11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim ac As String
Dim ar As New ADODB.Recordset
Dim acd As New ADODB.Connection
acd.Open "provider=Microsoft.Jet.OLEDB.4.0; data source=" & App.Path & "\图书馆.mdb"
If Trim(Text1.Text) <> Trim(Text2.Text) Then
MsgBox "两次输入的密码不一致,请重新输入"
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Exit Sub
Else
ac = "select * from 密码 where 用户名='" & username & "'"
ar.Open ac, acd, adOpenKeyset, adLockPessimistic
ar.Fields(1) = Text1.Text
ar.Update
MsgBox "密码修改成功", vbOKOnly + vbExclamation
Unload Me
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -