📄 口令修改.frm
字号:
VERSION 5.00
Begin VB.Form 口令修改
Caption = "图书管理系统"
ClientHeight = 2625
ClientLeft = 5355
ClientTop = 2445
ClientWidth = 4455
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 2625
ScaleWidth = 4455
Begin VB.TextBox txtOpNewpwd
Height = 285
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 4
Top = 1080
Width = 3015
End
Begin VB.TextBox txtopOriPwd
Height = 285
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 3
Top = 600
Width = 3015
End
Begin VB.TextBox Txtopid
Height = 285
Left = 1320
TabIndex = 2
Top = 120
Width = 3015
End
Begin VB.TextBox txtOpConpwd
Height = 285
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 1
Top = 1560
Width = 3015
End
Begin VB.CommandButton Change
Caption = "更改"
Height = 375
Left = 1920
TabIndex = 0
Top = 2160
Width = 855
End
Begin VB.Label Label24
AutoSize = -1 'True
Caption = "新口令"
Height = 180
Left = 240
TabIndex = 8
Top = 1080
Width = 540
End
Begin VB.Label Label25
AutoSize = -1 'True
Caption = "原口令"
Height = 180
Left = 240
TabIndex = 7
Top = 600
Width = 540
End
Begin VB.Label Label26
AutoSize = -1 'True
Caption = "用户ID"
Height = 180
Left = 240
TabIndex = 6
Top = 120
Width = 540
End
Begin VB.Label Label27
AutoSize = -1 'True
Caption = "确认新口令"
Height = 180
Left = 240
TabIndex = 5
Top = 1560
Width = 900
End
End
Attribute VB_Name = "口令修改"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Change_Click()
On Error GoTo deal
Dim rsOperator As ADODB.Recordset
Dim rsReader As ADODB.Recordset
If pwdflag = 1 Then
If (de.rsOperator.State = 0) Then de.Operator
Set rsOperator = de.rsOperator
'操作员号没有
If Trim(Txtopid) = "" Then MsgBox "请输入操作员号": Txtopid.SetFocus: ERR.Raise 3001
'操作员号不存在
rsOperator.Filter = "id = '" + Trim(Txtopid) + "'"
If rsOperator.BOF = True Then MsgBox "此操作员号不存在": Txtopid.SetFocus: ERR.Raise 3001
'操作员原口令不正确
rsOperator.Filter = "id = '" + Trim(Txtopid) + "' and " + " password = '" + txtopOriPwd + "'"
If rsOperator.BOF = True Then MsgBox "此密码不正确": txtopOriPwd.SetFocus: ERR.Raise 3001
'操作员新口令要有1位
'If Len(Trim(txtOpNewpwd)) < 6 Then MsgBox "操作员新口令要有6位": Exit Sub
'操作员新口令与确认口令不符
If Not txtOpNewpwd = txtOpConpwd Then MsgBox "请输入正确的确认口令!": txtOpConpwd.SetFocus: ERR.Raise 3001
'终于可以更改密码了。
With rsOperator
.Filter = "id = '" + Trim(Txtopid) + "' and " + " password = '" + Trim(txtopOriPwd) + "'"
!Password = Trim(txtOpConpwd)
.Update
.Filter = 0
MsgBox "您的密码已修改!请谨记"
Unload Me
End With
Else
If (de.rsReader.State = 0) Then de.reader
Set rsReader = de.rsReader
'读者号没有
If Trim(Txtopid) = "" Then MsgBox "请输入读者号": Txtopid.SetFocus: ERR.Raise 3001
'读者号不存在
rsReader.Filter = "readerid = '" + Trim(Txtopid) + "'"
If rsReader.BOF = True Then MsgBox "此读者号不存在": Txtopid.SetFocus: ERR.Raise 3001
'读者原口令不正确
rsReader.Filter = "readerid = '" + Trim(Txtopid) + "' and " + " password = '" + Trim(txtopOriPwd) + "'"
If rsReader.BOF = True Then MsgBox "此密码不正确": txtopOriPwd.SetFocus: ERR.Raise 3001
'读者新口令要有6位
'If Len(Trim(txtOpNewpwd)) < 6 Then MsgBox "读者新口令要有6位": Exit Sub
'读者新口令与确认口令不符
If Not txtOpNewpwd = txtOpConpwd Then MsgBox "请输入正确的确认口令!": txtOpConpwd.SetFocus: ERR.Raise 3001
'终于可以更改密码了。
With rsReader
.Filter = "Readerid = '" + Trim(Txtopid) + "' and " + " password = '" + Trim(txtopOriPwd) + "'"
!Password = txtOpConpwd
.Update
.Filter = 0
MsgBox "您的密码已修改!请谨记"
Unload Me
End With
End If
deal:
If ERR.Number = 3001 Then Exit Sub
End Sub
Private Sub Form_Load()
If pwdflag = 2 Then Txtopid = strReaderid
End Sub
Private Sub Form_Unload(Cancel As Integer)
' If pwdflag = 1 Then 系统操作.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -