📄 frmadminpwd.frm
字号:
VERSION 5.00
Begin VB.Form frmadminpwd
BorderStyle = 1 'Fixed Single
Caption = "更改用户密码"
ClientHeight = 2400
ClientLeft = 45
ClientTop = 435
ClientWidth = 4410
Icon = "frmadminpwd.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2400
ScaleWidth = 4410
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 2295
Left = 120
TabIndex = 0
Top = 0
Width = 4215
Begin VB.CommandButton Command2
Caption = "取消更改"
Height = 375
Left = 2280
TabIndex = 6
Top = 1560
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "确认更改"
Height = 375
Left = 480
TabIndex = 5
Top = 1560
Width = 1335
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 4
Top = 840
Width = 2535
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 3
Top = 240
Width = 2535
End
Begin VB.Label Label2
Caption = "确认新密码:"
Height = 255
Left = 240
TabIndex = 2
Top = 960
Width = 1095
End
Begin VB.Label Label1
Caption = "输入新密码:"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 1095
End
End
End
Attribute VB_Name = "frmadminpwd"
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\yh8888.mdb"
If Trim(Text1.Text) <> Trim(Text2.Text) Then
MsgBox "密码不一致!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Exit Sub
Else
sql = "select * from admin where 用户ID='" & username & "'"
rs_mima.Open sql, conn, adOpenKeyset, adLockPessimistic
rs_mima.Fields(2) = 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 + -