?? frmmodipass.frm
字號:
VERSION 5.00
Begin VB.Form FrmModiPass
BackColor = &H00E7DFE7&
BorderStyle = 1 'Fixed Single
Caption = "修改密碼"
ClientHeight = 3900
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
Icon = "FrmModiPass.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3900
ScaleWidth = 4680
Begin VB.CommandButton cmdExit
Cancel = -1 'True
Caption = "關閉"
Height = 495
Left = 2280
TabIndex = 11
Top = 3240
Width = 1335
End
Begin VB.CommandButton cmdOK
Caption = "確定"
Height = 495
Left = 480
TabIndex = 10
Top = 3240
Width = 1455
End
Begin VB.TextBox txtNewPass1
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
MaxLength = 10
PasswordChar = "*"
TabIndex = 7
Top = 2423
Width = 1695
End
Begin VB.TextBox txtNewPass
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
MaxLength = 10
PasswordChar = "*"
TabIndex = 5
Top = 1763
Width = 1695
End
Begin VB.TextBox txtOldPass
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
MaxLength = 10
PasswordChar = "*"
TabIndex = 3
Top = 1200
Width = 1695
End
Begin VB.TextBox txtUserName
BackColor = &H00E7DFE7&
Height = 375
Left = 1800
Locked = -1 'True
TabIndex = 9
TabStop = 0 'False
Top = 683
Width = 1695
End
Begin VB.TextBox txtUserId
Height = 375
Left = 1800
MaxLength = 10
TabIndex = 1
Top = 120
Width = 1695
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "確認密碼(&C)"
Height = 180
Left = 420
TabIndex = 6
Top = 2520
Width = 990
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "新密碼(&N):"
Height = 180
Left = 420
TabIndex = 4
Top = 1860
Width = 990
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "舊密碼(&P):"
Height = 180
Left = 420
TabIndex = 2
Top = 1320
Width = 990
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用戶名:"
Height = 180
Left = 420
TabIndex = 8
Top = 780
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用戶編號(&U):"
Height = 180
Left = 420
TabIndex = 0
Top = 240
Width = 1170
End
End
Attribute VB_Name = "FrmModiPass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Modipass As New OpenRs
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
If txtUserid.Text = "" Then
MsgBox "請輸入用戶編號!", vbOKOnly + vbInformation, "修改密碼"
txtUserid.SetFocus
Exit Sub
End If
If txtUsername.Text = "" Then
MsgBox "用戶編號不存在!", vbOKOnly + vbInformation, "修改密碼"
txtUserid.Text = ""
txtUserid.SetFocus
Exit Sub
End If
If txtOldPass.Text = "" Then
MsgBox "請輸入舊密碼!", vbOKOnly + vbInformation, "修改密碼"
txtOldPass.SetFocus
Exit Sub
End If
If txtNewPass.Text = "" Then
MsgBox "請輸入新密碼!", vbOKOnly + vbInformation, "修改密碼"
txtNewPass.SetFocus
Exit Sub
End If
If txtNewPass1.Text = "" Then
MsgBox "請輸入新密碼!", vbOKOnly + vbInformation, "修改密碼"
txtNewPass1.SetFocus
Exit Sub
End If
If txtNewPass.Text = txtNewPass1.Text Then
Modipass.rs1!user_pwd = txtNewPass.Text
Modipass.rs1.Update
MsgBox "密碼修改成功!", vbOKOnly + vbInformation, "修改密碼"
txtUserid.Text = ""
txtUserid.SetFocus
Else
MsgBox "兩次輸入的密碼不一致,請重新輸入!", vbOKOnly + vbInformation, "修改密碼"
txtNewPass.Text = ""
txtNewPass1.Text = ""
txtNewPass.SetFocus
End If
End Sub
Private Sub Form_Deactivate()
txtUserid.Text = ""
End Sub
Private Sub txtNewPass_GotFocus()
If txtOldPass.Text <> "" Then
If txtOldPass.Text <> Modipass.rs1!user_pwd Then
MsgBox "舊密碼不正確!", vbOKOnly + vbInformation, "修改密碼"
txtOldPass.Text = ""
txtOldPass.SetFocus
End If
Else
MsgBox "請輸入舊密碼!", vbOKOnly + vbInformation, "修改密碼"
txtOldPass.SetFocus
Exit Sub
End If
End Sub
Private Sub txtNewPass_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
ElseIf KeyAscii = 13 Then
txtNewPass1.SetFocus
End If
End Sub
Private Sub txtNewPass1_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
ElseIf KeyAscii = 13 Then
Call cmdOK_Click
End If
End Sub
Private Sub txtOldPass_GotFocus()
If txtUserid.Text = "" Then
MsgBox "請輸入用戶編號!", vbOKOnly + vbInformation, "修改密碼"
txtUserid.SetFocus
Exit Sub
End If
If txtUsername.Text = "" Then
MsgBox "用戶編號不存在!", vbOKOnly + vbInformation, "修改密碼"
txtUserid.Text = ""
txtUserid.SetFocus
End If
End Sub
Private Sub txtOldPass_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
ElseIf KeyAscii = 13 Then
txtNewPass.SetFocus
End If
End Sub
Private Sub txtUserId_Change()
txtUsername.Text = ""
txtOldPass.Text = ""
txtNewPass.Text = ""
txtNewPass1.Text = ""
End Sub
Private Sub txtUserId_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
ElseIf KeyAscii = 13 Then
txtOldPass.SetFocus
End If
End Sub
Private Sub txtUserId_LostFocus()
Modipass.rsDK1 "Select * from user_info where user_id='" & txtUserid.Text & "'"
If Modipass.rs1.EOF = False Then
txtUsername.Text = Modipass.rs1!user_name
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -