?? frmlogin.frm
字號(hào):
VERSION 5.00
Begin VB.Form frmlogin
Caption = "登錄事務(wù)管理系統(tǒng)"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2640
TabIndex = 5
Top = 2160
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 375
Left = 840
TabIndex = 4
Top = 2160
Width = 1215
End
Begin VB.TextBox txtpwd
Height = 285
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 3
Top = 1200
Width = 1935
End
Begin VB.TextBox txtuser
Height = 285
Left = 1560
TabIndex = 2
Top = 720
Width = 1935
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "密碼"
Height = 195
Left = 960
TabIndex = 1
Top = 1200
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "用戶名"
Height = 195
Left = 840
TabIndex = 0
Top = 720
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 '記錄確定次數(shù)
Private Sub Command1_Click()
Dim sql As String
Dim rs_login As New ADODB.Recordset
If Trim(txtuser.Text) = "" Then '判斷輸入的用戶名是否為空
MsgBox "沒有這個(gè)用戶", 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 "沒有這個(gè)用戶", vbOKOnly + vbExclamation, ""
txtuser.SetFocus
Else '檢驗(yàn)密碼是否正確
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.3.51;" & _
"data source=affair1.mdb"
conn.Open connectionstring
cnt = 0
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -