?? frmlogin.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmLogin
BackColor = &H8000000A&
BorderStyle = 3 'Fixed Dialog
Caption = "系統登錄"
ClientHeight = 2205
ClientLeft = 45
ClientTop = 330
ClientWidth = 5325
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frmLogin.frx":0442
ScaleHeight = 2205
ScaleWidth = 5325
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text3
DataField = "用戶姓名"
DataSource = "Adodc1"
Height = 285
Left = 270
TabIndex = 9
Top = 390
Visible = 0 'False
Width = 1395
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Height = 1980
Left = 2175
TabIndex = 0
Top = 105
Width = 2985
Begin VB.CommandButton Command2
BackColor = &H00FFFFFF&
Caption = "退 出(&E)"
Height = 315
Left = 1500
Style = 1 'Graphical
TabIndex = 5
Top = 1500
Width = 1215
End
Begin VB.CommandButton Command1
BackColor = &H00FFFFFF&
Caption = "登 錄(&L)"
Height = 315
Left = 195
Style = 1 'Graphical
TabIndex = 4
Top = 1500
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "frmLogin.frx":2F5B
Left = 1395
List = "frmLogin.frx":2F65
TabIndex = 3
Text = "-1"
Top = 1005
Width = 1275
End
Begin VB.TextBox Text2
Height = 300
IMEMode = 3 'DISABLE
Left = 1380
PasswordChar = "*"
TabIndex = 2
Top = 615
Width = 1275
End
Begin VB.TextBox Text1
Height = 300
Left = 1365
TabIndex = 1
Top = 225
Width = 1275
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "用戶類型:"
Height = 195
Left = 180
TabIndex = 8
Top = 1005
Width = 1215
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "用戶密碼:"
Height = 195
Left = 180
TabIndex = 7
Top = 615
Width = 1215
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用戶名:"
Height = 195
Left = 180
TabIndex = 6
Top = 225
Width = 1215
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 90
Top = 960
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
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
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub
Private Sub Command1_Click()
If Text3.Text = "" Then
MsgBox "您還沒有注冊系統用戶!", , "系統提示"
MDIForm1.Show
Unload Me
Exit Sub
End If
Set adors = adoCon.Execute("select * from 用戶表 where 用戶姓名=ltrim('" & Text1 & "') and 密碼=ltrim('" & Text2 & "') and 用戶類型=ltrim('" & Combo1.Text & "')")
If adors.EOF Then
MsgBox "您輸入的信息有誤,請重新輸入!", , "系統提示"
Text1 = ""
Text2 = ""
Text1.SetFocus
i = i + 1
If i = 3 Then
MsgBox "對不起,您已無權使用本系統!", , "系統提示"
Unload Me
End If
Else
Select Case adors!用戶類型
Case "管理員"
Case "普通用戶"
MDIForm1.mnuyydelete.Enabled = False
MDIForm1.mnusyscsh.Enabled = False
MDIForm1.mnuglyset.Enabled = False
End Select
MDIForm1.Show
adors.Close
Unload Me
End If
End Sub
Private Sub Command2_Click()
Unload Me
'adoRs.Close
End Sub
Private Sub Form_Load()
Combo1.ListIndex = 0
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Combo1.SetFocus
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -