?? frmlogin.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmlogin
Caption = "用戶登錄"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 720
Top = 2640
Visible = 0 'False
Width = 1575
_ExtentX = 2778
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2520
TabIndex = 5
Top = 2040
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 375
Left = 840
TabIndex = 4
Top = 2040
Width = 1095
End
Begin VB.TextBox text2
Height = 285
IMEMode = 3 'DISABLE
Left = 1800
TabIndex = 3
Top = 1200
Width = 1575
End
Begin VB.TextBox text1
Height = 285
Left = 1800
TabIndex = 2
Top = 600
Width = 1575
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "密碼"
Height = 195
TabIndex = 1
Top = 1200
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "用戶名"
Height = 195
Left = 960
TabIndex = 0
Top = 600
Width = 540
End
End
Attribute VB_Name = "frmlogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim cnt As Integer '記錄確定次數
Private Sub Command1_Click()
Dim sql As String
Dim rs_login As New ADODB.Recordset
If Trim(Text1.Text) = "" Then '判斷輸入的用戶名是否為空
MsgBox "沒有這個用戶", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Else
sql = "select * from 系統管理 where 用戶名='" & Text1.Text & "'"
rs_login.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_login.EOF = True Then
MsgBox "沒有這個用戶", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Else '檢驗密碼是否正確
If Trim(rs_login.Fields(1)) = Trim(Text2.Text) Then
userID = Text1.Text
userpow = rs_login.Fields(2)
rs_login.Close
Unload Me
MDIForm1.Show
Else
MsgBox "密碼不正確", vbOKOnly + vbExclamation, ""
Text2.SetFocus
End If
End If
End If
cnt = cnt + 1
If cnt = 3 Then
Unload Me
End If
Exit Sub
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim connectionstring As String
connectionstring = "provider=Microsoft.Jet.oledb.4.0;" & _
"data source=jiudian.mdb"
conn.Open connectionstring
cnt = 0
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -