📄 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 + -