?? frmmodifypass.frm
字號:
VERSION 5.00
Begin VB.Form frmModifyPass
Caption = "修改密碼"
ClientHeight = 5715
ClientLeft = 60
ClientTop = 345
ClientWidth = 4875
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5715
ScaleWidth = 4875
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command2
Caption = "重置"
Height = 615
Left = 2520
TabIndex = 3
Top = 4440
Width = 1815
End
Begin VB.CommandButton Command1
Caption = "修改"
Height = 615
Left = 360
TabIndex = 2
Top = 4440
Width = 1815
End
Begin VB.TextBox txtAffirmPasswd
Height = 615
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 1
Top = 2760
Width = 1575
End
Begin VB.TextBox txtNewPasswd
Height = 495
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 0
Top = 1560
Width = 1575
End
Begin VB.TextBox txtUserName
Height = 495
Left = 2400
TabIndex = 7
Top = 360
Width = 1575
End
Begin VB.Label Label4
Caption = "確認密碼"
Height = 615
Left = 600
TabIndex = 6
Top = 2760
Width = 1575
End
Begin VB.Label Label3
Caption = "新密碼"
Height = 615
Left = 600
TabIndex = 5
Top = 1560
Width = 1455
End
Begin VB.Label Label1
Caption = "用戶名"
Height = 375
Left = 600
TabIndex = 4
Top = 480
Width = 1335
End
End
Attribute VB_Name = "frmModifyPass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim rsRecordSet As New ADODB.Recordset
strsql = "Select * From employees where userName ='" & Trim(txtUserName.Text) & "'"
rsRecordSet.Open strsql, connConnection, adOpenKeyset, adLockPessimistic
rsRecordSet.Fields(2) = Trim(txtNewPasswd.Text)
rsRecordSet.Update
MsgBox "密碼已修改", , "Successful"
rsRecordSet.Close
Unload Me
End Sub
Private Sub Command2_Click()
txtOldPasswd.Text = ""
txtNewPasswd.Text = ""
txtAffirmPasswd.Text = ""
End Sub
Private Sub txtAffirmPasswd_LostFocus()
If txtNewPasswd.Text <> txtAffirmPasswd.Text Then
MsgBox "兩次輸入的密碼不一致,請重新輸入", , "Error"
txtNewPasswd.SetFocus
End If
End Sub
'Dim rs_chang As New ADODB.Recordset
'Dim sql As String
'sql = "select * from system where sysname='" & userID & "'"
' rs_chang.Open sql, conn, adOpenKeyset, adLockPessimistic
' rs_chang.Fields(1) = Text1.Text
' rs_chang.Update
' rs_chang.Close
' MsgBox "密碼修改成功", vbOKOnly + vbExclamation, ""
' Unload Me
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -