📄 frmmodifymima.frm
字号:
VERSION 5.00
Begin VB.Form 更改密码
BackColor = &H8000000B&
Caption = "更改密码"
ClientHeight = 1545
ClientLeft = 60
ClientTop = 450
ClientWidth = 3300
LinkTopic = "Form1"
ScaleHeight = 1545
ScaleWidth = 3300
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
BackColor = &H00C0C0C0&
Caption = "取消"
Height = 375
Left = 1800
TabIndex = 5
Top = 1080
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "确认"
Height = 375
Left = 120
TabIndex = 4
Top = 1080
Width = 1335
End
Begin VB.TextBox Text2
BackColor = &H00E0E0E0&
Height = 375
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 3
Top = 600
Width = 1815
End
Begin VB.TextBox Text1
BackColor = &H00E0E0E0&
Height = 375
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 2
Top = 120
Width = 1815
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "确认新密码:"
Height = 375
Left = 120
TabIndex = 1
Top = 600
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "输入新密码:"
Height = 375
Left = 120
TabIndex = 0
Top = 120
Width = 1215
End
End
Attribute VB_Name = "更改密码"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim conn As New ADODB.Connection
Dim rs_mima As New ADODB.Recordset
Dim sql As String
conn.Open "provider=Microsoft.Jet.OLEDB.4.0; data source=" & App.Path & "\database.mdb"
If Trim(Text1.Text) <> Trim(Text2.Text) Then
MsgBox "密码不一致!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Exit Sub
Else
sql = "select * from 用户表 where user_ID='" & username & "'"
rs_mima.Open sql, conn, adOpenKeyset, adLockPessimistic
rs_mima.Fields(1) = Text1.Text
rs_mima.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 + -