?? frmchangepwd.frm
字號:
VERSION 5.00
Begin VB.Form frmChangePwd
BackColor = &H000080FF&
BorderStyle = 3 'Fixed Dialog
Caption = "修改密碼"
ClientHeight = 4290
ClientLeft = 45
ClientTop = 435
ClientWidth = 5505
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4290
ScaleWidth = 5505
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3360
TabIndex = 6
Top = 3600
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 375
Left = 1320
TabIndex = 5
Top = 3600
Width = 1215
End
Begin VB.Frame Frame1
BackColor = &H000080FF&
Height = 3015
Left = 480
TabIndex = 0
Top = 360
Width = 4815
Begin VB.TextBox Text1
Height = 375
Left = 1920
TabIndex = 1
Top = 360
Width = 1815
End
Begin VB.TextBox Text2
Height = 375
Left = 1920
TabIndex = 2
Top = 960
Width = 1815
End
Begin VB.TextBox Text3
Height = 375
Left = 1920
TabIndex = 3
Top = 1560
Width = 1815
End
Begin VB.TextBox Text4
Height = 375
Left = 1920
TabIndex = 4
Top = 2160
Width = 1815
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用戶名:"
Height = 495
Left = 960
TabIndex = 10
Top = 480
Width = 1215
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "原密碼:"
Height = 495
Left = 960
TabIndex = 9
Top = 1080
Width = 1215
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "新密碼:"
Height = 495
Left = 960
TabIndex = 8
Top = 1680
Width = 1215
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "新密碼:"
Height = 495
Left = 960
TabIndex = 7
Top = 2280
Width = 1215
End
End
End
Attribute VB_Name = "frmChangePwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim stremployee As String
Dim rs_employee As New ADODB.Recordset
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "請填寫用戶名!", vbOKOnly + vbInformation, "注意"
Text1.SetFocus
Exit Sub
ElseIf Text2.Text = "" Then
MsgBox "請填寫原密碼!", vbOKOnly + vbInformation, "注意"
Text2.SetFocus
Exit Sub
ElseIf Text3.Text = "" Then
MsgBox "請填寫新密碼!", vbOKOnly + vbInformation, "注意"
Text3.SetFocus
Exit Sub
ElseIf Text4.Text = "" Then
MsgBox "請填寫新密碼!", vbOKOnly + vbInformation, "注意"
Text4.SetFocus
Exit Sub
End If
If Text3.Text <> Text4.Text Then
MsgBox "兩次輸入的密碼不同,請重新輸入!", vbOKOnly + vbInformation, ""
Text3.Text = ""
Text4.Text = ""
Text3.SetFocus
Exit Sub
End If
stremployee = "select * from employee where 員工姓名='" & Text1.Text & "'"
rs_employee.Open stremployee, cnn, adOpenStatic, adLockOptimistic
If rs_employee.EOF = True Then
MsgBox "用戶名或原密碼有錯誤!", vbOKOnly + vbExclamation, ""
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
rs_employee.Close
Else
rs_employee.Fields("員工密碼") = Text3.Text
rs_employee.Update
MsgBox "修改密碼成功!", vbOKOnly + vbInformation, ""
rs_employee.Close
Unload Me
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -