📄 frm_dl.frm
字号:
VERSION 5.00
Begin VB.Form FRM_DL
BorderStyle = 3 'Fixed Dialog
Caption = "班级管理 -- 登录"
ClientHeight = 4245
ClientLeft = 5235
ClientTop = 2700
ClientWidth = 5520
Icon = "FRM_DL.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4245
ScaleWidth = 5520
ShowInTaskbar = 0 'False
Begin VB.ComboBox Combo1
Height = 300
Left = 1800
TabIndex = 7
Text = "Combo1"
Top = 840
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
TabIndex = 6
Top = 1320
Width = 1455
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access 2000;"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 615
Left = 960
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 3120
Visible = 0 'False
Width = 2895
End
Begin VB.CommandButton CMD_YLLZSFDL
Caption = "以浏览者身分登录"
Height = 375
Left = 480
TabIndex = 5
Top = 2400
Width = 2895
End
Begin VB.CommandButton CMD_QD
Caption = "确定"
Height = 375
Left = 480
TabIndex = 1
Top = 1920
Width = 1095
End
Begin VB.CommandButton CMD_TC
Caption = "退出"
Height = 375
Left = 2160
TabIndex = 0
Top = 1920
Width = 1215
End
Begin VB.Label Label1
Caption = "管理员登录"
BeginProperty Font
Name = "黑体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1080
TabIndex = 4
Top = 120
Width = 2295
End
Begin VB.Label Label3
Caption = "密码:"
Height = 255
Left = 480
TabIndex = 3
Top = 1485
Width = 855
End
Begin VB.Label Label2
Caption = "操作员:"
Height = 255
Left = 480
TabIndex = 2
Top = 840
Width = 855
End
End
Attribute VB_Name = "FRM_DL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Tim As Integer '用以记录登录错误的次数
Dim i As Integer
Dim a As Integer
Private Sub CMD_TC_Click()
End
End Sub
Private Sub CMD_YLLZSFDL_Click()
'以浏览者身分登录时,设置系统操作员为“浏览者”
g_XTCZY = "浏览者"
Unload Me
MAIN.Show
End Sub
Private Sub Form_Load()
'设置 DATA 连接“MIMA”表
Show
Data1.DatabaseName = "student.MDB"
Data1.RecordSource = "MIMA"
Data1.Refresh
Text1.PasswordChar = "*"
Combo1.Text = Data1.Recordset.Fields("操作员")
Do Until Data1.Recordset.EOF
Combo1.AddItem Data1.Recordset.Fields("操作员")
Data1.Recordset.MoveNext
Loop
End Sub
Private Sub CMD_QD_Click()
On Error Resume Next
'验证所选操作员的对应密码
Data1.RecordSource = "SELECT * FROM MIMA WHERE 操作员 = '" & Combo1.Text & "'"
Data1.Refresh
'操作员输入有误,重输
If Data1.Recordset.RecordCount = 0 Then
MsgBox "无该操作员,请检查后重新输入!", vbOKOnly + vbInformation, "登录"
Combo1.SetFocus
Exit Sub
End If
'验证通过,进入主界面
If Text1.Text = Data1.Recordset.Fields("密码") Then
g_XTCZY = Combo1.Text '记录系统管理员信息
Load MAIN
MAIN.Show
Unload Me
Else
'密码错超过三次,退出
If Tim = 2 Then
MsgBox "密码错误,请向系统管理员查询!", vbCritical + vbOKOnly, "登录"
End
End If
'操作员为空,请求输入
If Combo1.Text = "" Then
MsgBox ("请输入操作员!")
Combo1.SetFocus
Else
'密码为空,请求输入
If Text1.Text = "" Then
MsgBox ("请输入密码!")
Text1.SetFocus
Else
'密码有误,错误次数加一
If Text1.Text <> Data1.Recordset.Fields("密码") Then
MsgBox ("密码错误,请重新输入!")
Tim = Tim + 1
Text1.SetFocus
Text1.Text = ""
End If
End If
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -