📄 frmmodifypwd.frm
字号:
VERSION 5.00
Begin VB.Form frmmodifypwd
Caption = "修改密码"
ClientHeight = 4575
ClientLeft = 60
ClientTop = 450
ClientWidth = 5715
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 4575
ScaleWidth = 5715
Begin VB.TextBox txtusername
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2640
TabIndex = 5
Top = 360
Width = 2295
End
Begin VB.TextBox txtpwd
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 2640
PasswordChar = "*"
TabIndex = 4
Top = 1080
Width = 2295
End
Begin VB.TextBox txtnewpwd
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 2640
PasswordChar = "*"
TabIndex = 3
Top = 1800
Width = 2295
End
Begin VB.TextBox txtnewpwd1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 2640
PasswordChar = "*"
TabIndex = 2
Top = 2520
Width = 2295
End
Begin VB.CommandButton cmdok
Caption = "确 定"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 960
TabIndex = 1
Top = 3600
Width = 1335
End
Begin VB.CommandButton cmdcancel
Caption = "取 消"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3240
TabIndex = 0
Top = 3600
Width = 1335
End
Begin VB.Label Label1
Caption = "请输入用户名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 9
Top = 480
Width = 1695
End
Begin VB.Label Label2
Caption = "请输入原密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 480
TabIndex = 8
Top = 1200
Width = 1815
End
Begin VB.Label Label3
Caption = "请输入新密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 480
TabIndex = 7
Top = 1920
Width = 1935
End
Begin VB.Label Label4
Caption = "请确认原密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 480
TabIndex = 6
Top = 2520
Width = 1935
End
End
Attribute VB_Name = "frmmodifypwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim con As ADODB.Connection
Private Sub cmdOK_Click()
Dim myrs As New ADODB.Recordset
myrs.Open "SELECT * FROM 用户信息", con, adOpenDynamic, adLockOptimistic, adCmdText
If Trim(txtnewpwd.Text) <> Trim(txtnewpwd1.Text) Then
MsgBox "两次输入密码不一样,请确认!", vbOKOnly + vbExclamation, "警告"
txtnewpwd.SetFocus
txtnewpwd.Text = ""
txtnewpwd1.Text = ""
Exit Sub
Else
If txtnewpwd.Text = "" Then
MsgBox "密码不能为空!", vbOKOnly + vbExclamation, "警告"
txtnewpwd.SetFocus
txtnewpwd.Text = ""
txtnewpwd1.Text = ""
Else
myrs.Fields(1) = txtnewpwd.Text
myrs.Update
myrs.Close
MsgBox "密码修改成功!", vbOKOnly + vbExclamation, "修改密码"
Me.Hide
End If
End If
End Sub
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub Form_Load()
'创建连接,并打开
Set con = New ADODB.Connection
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\数据.mdb;Persist Security Info=False"
con.Open
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -