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