📄 changepassword.frm
字号:
VERSION 5.00
Begin VB.Form changepassword
BackColor = &H00C0C0C0&
Caption = "用户密码修改"
ClientHeight = 3060
ClientLeft = 5505
ClientTop = 1890
ClientWidth = 4560
Icon = "changepassword.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3060
ScaleWidth = 4560
Begin VB.CommandButton Command2
Caption = "关 闭"
Height = 495
Left = 2520
TabIndex = 8
Top = 2520
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "修 改"
Height = 495
Left = 600
TabIndex = 7
Top = 2520
Width = 1455
End
Begin VB.Frame Frame1
BackColor = &H00C0C0C0&
Caption = "修改密码"
Height = 2295
Left = 120
TabIndex = 0
Top = 120
Width = 4335
Begin VB.TextBox Text3
Height = 270
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 6
Top = 1560
Width = 2415
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 5
Top = 1080
Width = 2415
End
Begin VB.TextBox Text1
Height = 270
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 4
Top = 600
Width = 2415
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "确 认:"
Height = 180
Left = 360
TabIndex = 3
Top = 1680
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "新密码:"
Height = 180
Left = 360
TabIndex = 2
Top = 1140
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "旧密码:"
Height = 180
Left = 360
TabIndex = 1
Top = 600
Width = 720
End
End
End
Attribute VB_Name = "changepassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim chpacn As New ADODB.Connection
Dim chparsuser As New ADODB.Recordset
Private Sub Command1_Click()
If Text1.Text <> chparsuser(2) Then
nul = MsgBox("旧密码不正确!请注意您的输入!", vbOKOnly + vbInformation, "提示")
Text1.Text = ""
Else
If Text2.Text = "" Or Text3.Text = "" Then
nul = MsgBox("新密码不能为空!", vbOKOnly, "提示")
Else
If Text2.Text <> Text3.Text Then
nul = MsgBox("两次输入的新密码不一致!", vbOKOnly + vbInformation, "错误:")
Text2.Text = ""
Text3.Text = ""
Else
chparsuser("密码") = Text2.Text
chparsuser.Update
nul = MsgBox("密码修改成功!", vbOKOnly + vbInformation, "提示")
End If
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set chpacn = New Connection
chpacn.ConnectionString = "provider=Microsoft.Jet.OLEDB.3.51;data source=book.mdb;"
chpacn.CursorLocation = adUseClient
chpacn.Open
Set chparsuser = New Recordset
chparsuser.CursorLocation = adUseClient
chpasql = "select * from admin where admin = " + Chr$(34) + loguser + Chr$(34)
chparsuser.Open chpasql, chpacn, adOpenDynamic, adLockOptimistic
End Sub
Private Sub Form_Unload(Cancel As Integer)
chpacn.Close
main.Show
main.Enabled = True
End Sub
Private Sub Text1_GotFocus()
Text1.BackColor = &HFFC0C0
End Sub
Private Sub Text1_LostFocus()
Text1.BackColor = &H80000014
End Sub
Private Sub Text2_GotFocus()
Text2.BackColor = &HFFC0C0
End Sub
Private Sub Text2_LostFocus()
Text2.BackColor = &H80000014
End Sub
Private Sub Text3_GotFocus()
Text3.BackColor = &HFFC0C0
End Sub
Private Sub Text3_LostFocus()
Text3.BackColor = &H80000014
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -