📄 editpass.frm
字号:
VERSION 5.00
Begin VB.Form frmEditPass
BackColor = &H00FFC0C0&
Caption = "修改密码"
ClientHeight = 2175
ClientLeft = 60
ClientTop = 450
ClientWidth = 4020
LinkTopic = "Form1"
ScaleHeight = 2175
ScaleWidth = 4020
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2280
TabIndex = 3
Top = 1560
Width = 975
End
Begin VB.CommandButton Command1
Caption = "修改"
Height = 375
Left = 840
TabIndex = 2
Top = 1560
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 1
Top = 960
Width = 1695
End
Begin VB.TextBox Text1
Height = 270
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 0
Top = 480
Width = 1695
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "确认新密码:"
Height = 255
Left = 600
TabIndex = 5
Top = 960
Width = 1095
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "输入新密码:"
Height = 255
Left = 600
TabIndex = 4
Top = 480
Width = 1095
End
End
Attribute VB_Name = "frmEditPass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim conn As New ADODb.Connection
Dim rs_edit As New ADODb.Recordset
Dim sql_edit As String
Private Sub Command1_Click()
If Text1.Text <> text2.Text Then
MsgBox "两次输入的密码不一致!", vbOKOnly + vbExclamation, "提示"
Text1.SetFocus
Text1.Text = ""
text2.Text = ""
Else
rs_edit.Close
sql_edit = "select * from 管理员 where 登录帐号='" & UserName & "'"
rs_edit.Open sql_edit, conn, adOpenKeyset, adLockPessimistic
rs_edit.Fields("登录密码") = Text1.Text
rs_edit.Update
MsgBox "密码修改成功", vbOKOnly + vbExclamation, "提示"
Unload Me
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
DBpath = App.Path + "\database\school.mdb"
strSql = "provider=Microsoft.Jet.oledb.4.0;data source=" & DBpath & ";Jet OLEDB:Database Password=" & pwd & ";"
conn.Open strSql
sql_edit = "select * from 管理员"
rs_edit.Open sql_edit, conn, adOpenKeyset, adLockPessimistic
End Sub
Private Sub Form_Unload(Cancel As Integer)
rs_edit.Close
Set rs_edit = Nothing
conn.Close
Set conn = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -