?? frmlogin.frm
字號:
VERSION 5.00
Begin VB.Form 身份驗證
BackColor = &H00C0C0C0&
Caption = "歡迎進入圖書館管理系統"
ClientHeight = 3390
ClientLeft = 60
ClientTop = 450
ClientWidth = 4665
LinkTopic = "Form1"
ScaleHeight = 3390
ScaleWidth = 4665
StartUpPosition = 1 '所有者中心
Begin VB.TextBox text1
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1680
TabIndex = 2
Top = 600
Width = 1815
End
Begin VB.TextBox text2
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 3
Top = 1440
Width = 1815
End
Begin VB.CommandButton cmdOK
Caption = "確 定"
Height = 495
Left = 1080
TabIndex = 4
Top = 2520
Width = 1095
End
Begin VB.CommandButton cmdCancle
Caption = "取消"
Height = 495
Left = 2640
TabIndex = 5
Top = 2520
Width = 1215
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
Caption = "用戶名:"
Height = 255
Left = 480
TabIndex = 0
Top = 600
Width = 735
End
Begin VB.Label Label2
BackColor = &H00C0C0C0&
Caption = "密碼:"
Height = 255
Left = 480
TabIndex = 1
Top = 1560
Width = 615
End
End
Attribute VB_Name = "身份驗證"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim cnt As Integer '記錄確定次數
Private Sub cmdCancle_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim sql As String
Dim rs_login As New ADODB.Recordset
Dim conn As New ADODB.Connection
conn.Open "provider=Microsoft.Jet.OLEDB.4.0; data source=" & App.Path & "\database.mdb"
If Trim(Text1.Text) = "" Then
MsgBox "用戶名不能為空,請重新輸入!"
Text1.SetFocus
Else
sql = "select * from 用戶表 where user_ID='" & Trim(Text1.Text) & "'"
rs_login.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_login.EOF = True Then
MsgBox "沒有這個用戶,請重輸入!", vbOKOnly + vbExclamation, ""
Text1.Text = ""
Text1.SetFocus
Else
username = Text1.Text
If Trim(rs_login.Fields(1)) = Trim(Text2.Text) Then
Unload Me
圖書館理系統.Show
Else
MsgBox "密碼不正確,請重輸入!", vbOKOnly + vbExclamation, ""
Text2.SetFocus
Text2.Text = ""
End If
End If
End If
cnt = cnt + 1
If cnt = 3 Then
Unload Me
End If
End Sub
Private Sub Form_Load()
cnt = 0
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -