📄 管理员验证.frm
字号:
VERSION 5.00
Begin VB.Form 管理员验证
Caption = "图书管理系统"
ClientHeight = 2160
ClientLeft = 5775
ClientTop = 2715
ClientWidth = 4680
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 2160
ScaleWidth = 4680
Begin VB.CommandButton OK
Caption = "确定"
Height = 375
Left = 1920
TabIndex = 2
Top = 1560
Width = 855
End
Begin VB.TextBox Txtopid
Height = 285
Left = 1320
TabIndex = 0
Top = 360
Width = 3015
End
Begin VB.TextBox txtopPwd
Height = 285
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 1
Top = 840
Width = 3015
End
Begin VB.Label Label26
AutoSize = -1 'True
Caption = "管理员号"
Height = 180
Left = 240
TabIndex = 4
Top = 360
Width = 720
End
Begin VB.Label Label25
AutoSize = -1 'True
Caption = "管理员口令"
Height = 180
Left = 240
TabIndex = 3
Top = 840
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 Form_Unload(Cancel As Integer)
主界面.Show
End Sub
Private Sub OK_Click()
On Error GoTo ERR
Static count As Integer
Dim rsOperator As ADODB.Recordset
Dim rsReader As ADODB.Recordset
If count > 1 Then count = 0: MsgBox "你不是管理员。你无权进行系统操作!": Unload Me: 主界面.Show: ERR.Raise 3001
' If de.rsOperator.State = 0 Then de.Operator
Set rsOperator = de.rsOperator
'操作员号没有
If Trim(Txtopid) = "" Then MsgBox "请输入操作员号": Txtopid.SetFocus: count = count + 1: ERR.Raise 3001
'操作员号不存在
rsOperator.Filter = "id = '" + Trim(Txtopid) + "'"
If rsOperator.BOF = True Then MsgBox "此操作员号不存在": Txtopid.SetFocus: count = count + 1: ERR.Raise 3001
'操作员原口令不正确
rsOperator.Filter = "id = '" + Trim(Txtopid) + "' and " + " password = '" + txtopPwd + "'"
If rsOperator.BOF = True Then MsgBox "此密码不正确": txtopPwd.SetFocus: count = count + 1: ERR.Raise 3001
MsgBox "你好!管理员"
Unload Me
主界面.Hide '继续使主界面处于隐藏状态
系统操作.Show
Exit Sub
ERR:
If ERR.Number = 3001 Then Exit Sub
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -