📄 +_
字号:
VERSION 5.00
Begin VB.Form 密改
BorderStyle = 5 'Sizable ToolWindow
Caption = "Form1"
ClientHeight = 2100
ClientLeft = 60
ClientTop = 285
ClientWidth = 4890
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2100
ScaleWidth = 4890
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txtUserName
Height = 270
IMEMode = 3 'DISABLE
Left = 2003
PasswordChar = "*"
TabIndex = 0
Top = 240
Width = 2325
End
Begin VB.TextBox txtPassword1
Height = 270
IMEMode = 3 'DISABLE
Left = 2003
PasswordChar = "*"
TabIndex = 1
Top = 720
Width = 2325
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 360
Left = 435
TabIndex = 3
Tag = "1059"
Top = 1560
Width = 1140
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 360
Left = 3315
TabIndex = 4
Tag = "1060"
Top = 1560
Width = 1140
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "C:\Program Files\Common Files\main.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 1920
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "人员设定"
Top = 1560
Visible = 0 'False
Width = 1065
End
Begin VB.TextBox Txtpassword2
Height = 270
IMEMode = 3 'DISABLE
Left = 2003
PasswordChar = "*"
TabIndex = 2
Top = 1200
Width = 2325
End
Begin VB.Label xt
Alignment = 2 'Center
Caption = "旧密码(&U):"
Height = 255
Left = 570
TabIndex = 7
Tag = "1057"
Top = 240
Width = 1080
End
Begin VB.Label passwork1
Alignment = 2 'Center
Caption = "新密码(&P):"
Height = 255
Left = 570
TabIndex = 6
Tag = "1058"
Top = 720
Width = 1080
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "确认密码(&P):"
Height = 255
Left = 570
TabIndex = 5
Tag = "1058"
Top = 1200
Width = 1080
End
End
Attribute VB_Name = "密改"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public OK As Boolean
Private Sub cmdCancel_Click()
OK = False
Unload Me
End Sub
Private Sub cmdOK_Click()
Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
If Data1.Recordset.Fields("工作人员") = frist.txtUserName.Text Then
If nofrom(Data1.Recordset.Fields("密码")) = txtUserName.Text Then
If txtPassword1.Text = Txtpassword2.Text And txtPassword1.Text <> "" Then
Data1.Recordset.Edit
Data1.Recordset.Fields("密码") = from(txtPassword1.Text)
Data1.Recordset.Update
OK = True
MsgBox "密码修改成功!"
Unload Me
Exit Do
Else
MsgBox "密码输入不一致!再试一次!", , "登录"
txtPassword1.SetFocus
txtPassword1.SelStart = 0
txtPassword1.SelLength = Len(txtPassword1.Text)
Exit Do
End If
Else
MsgBox "旧密码输入错误,再试一次!", , "登录"
txtUserName.SetFocus
txtUserName.SelStart = 0
txtUserName.SelLength = Len(txtUserName.Text)
Exit Do
End If
End If
Data1.Recordset.MoveNext
Loop
If Data1.Recordset.EOF Then
MsgBox "查无此工作人员!!"
txtUserName.SetFocus
txtUserName.SelStart = 0
txtUserName.SelLength = Len(txtUserName.Text)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -