?? form1.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "登錄"
ClientHeight = 2865
ClientLeft = 60
ClientTop = 450
ClientWidth = 3795
LinkTopic = "Form1"
ScaleHeight = 2865
ScaleWidth = 3795
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 2280
TabIndex = 5
Top = 1920
Width = 975
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 495
Left = 600
TabIndex = 2
Top = 1920
Width = 1095
End
Begin VB.TextBox txtpwd
Height = 375
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 1
Top = 1200
Width = 1335
End
Begin VB.TextBox txtuser
Height = 375
Left = 1440
TabIndex = 0
Top = 360
Width = 1335
End
Begin VB.Label Label2
Caption = "密碼"
Height = 375
Left = 600
TabIndex = 4
Top = 1200
Width = 855
End
Begin VB.Label Label1
Caption = "用戶名"
Height = 375
Left = 600
TabIndex = 3
Top = 360
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim cnt As Integer '記錄確定次數(shù)
Private Sub Command1_Click()
Dim sql As String
Dim rs_login As New ADODB.Recordset
If Trim(txtuser.Text) = "" Then '判斷輸入的用戶名是否為空
MsgBox "沒有這個用戶", vbOKOnly + vbExclamation, ""
txtuser.SetFocus
Else
sql = "select * from 系統(tǒng)管理 where 用戶名='" & txtuser.Text & "'"
rs_login.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_login.EOF = True Then
MsgBox "沒有這個用戶", vbOKOnly + vbExclamation, ""
txtuser.SetFocus
Else '檢驗密碼是否正確
If Trim(rs_login.Fields(1)) = Trim(txtpwd.Text) Then
userID = txtuser.Text
userpow = rs_login.Fields(2)
rs_login.Close
Unload Me
MDIForm1.Show
Else
MsgBox "密碼不正確", vbOKOnly + vbExclamation, ""
txtpwd.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=carshale.mdb"
conn.Open connectionstring
cnt = 0
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -