?? frmlogin.frm
字號:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "Login"
ClientHeight = 3630
ClientLeft = 45
ClientTop = 435
ClientWidth = 4830
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frmLogin.frx":0000
ScaleHeight = 3630
ScaleWidth = 4830
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.ComboBox Combo1
Height = 300
Left = 2160
TabIndex = 3
Top = 960
Width = 1335
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 2
Top = 1440
Width = 1335
End
Begin VB.Label Label5
BackColor = &H80000001&
BackStyle = 0 'Transparent
Caption = " 超市管理系統"
BeginProperty Font
Name = "宋體"
Size = 24
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 360
TabIndex = 6
Top = 240
Width = 4215
End
Begin VB.Label Label4
AutoSize = -1 'True
BackColor = &H00C000C0&
BackStyle = 0 'Transparent
Caption = "退出"
BeginProperty Font
Name = "宋體"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 435
Left = 2880
TabIndex = 5
Top = 2520
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackColor = &H00C000C0&
BackStyle = 0 'Transparent
Caption = "確定"
BeginProperty Font
Name = "宋體"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 435
Left = 1080
TabIndex = 4
Top = 2520
Width = 900
End
Begin VB.Label Label2
BackColor = &H000000C0&
BackStyle = 0 'Transparent
Caption = "密碼"
Height = 255
Left = 1320
TabIndex = 1
Top = 1560
Width = 615
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用戶名"
Height = 255
Left = 1320
TabIndex = 0
Top = 960
Width = 735
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim stremployee As String
Dim rs_employee As New ADODB.Recordset
Private Sub Form_Activate()
stremployee = "select * from employee "
rs_employee.Open stremployee, cnn, adOpenStatic, adLockOptimistic
Dim i As Integer
For i = 0 To rs_employee.RecordCount - 1
Combo1.AddItem (rs_employee.Fields("員工姓名"))
rs_employee.MoveNext
Next
rs_employee.Close
End Sub
Private Sub Form_Load()
cnn.Provider = "microsoft.jet.oledb.4.0"
cnn.ConnectionString = App.Path & "\sellsystem.mdb"
cnn.Open
End Sub
Private Sub Picture1_Click()
End Sub
Private Sub Label3_Click()
If Combo1.Text = "" Then
MsgBox "請輸入用戶名!", vbOKOnly + vbInformation, "注意"
Combo1.SetFocus
Exit Sub
ElseIf Text1.Text = "" Then
MsgBox "請輸入密碼!", vbOKOnly + vbInformation, "注意"
Text1.SetFocus
Exit Sub
End If
stremployee = "select * from employee where 員工姓名='" & Combo1.Text & "' and 員工密碼='" & Text1.Text & "'"
rs_employee.Open stremployee, cnn, adOpenStatic, adLockOptimistic
If rs_employee.EOF = True Then
MsgBox "用戶名或密碼錯誤,請從新輸入!", vbOKOnly + vbInformation, "注意"
Combo1.SetFocus
rs_employee.Close
Exit Sub
Else
strs = rs_employee.Fields("員工編號")
rs_employee.Close
End If
If Combo1.Text = "administrator" Then
frminitial.Show
Else
frmMain.Show
frmMain.mnBuyAll.Enabled = False
frmMain.mnSellAll.Enabled = False
frmMain.mnTable.Enabled = False
End If
Unload Me
End Sub
Private Sub Label4_Click()
Unload Me
cnn.Close
End Sub
Private Sub Picture2_Click()
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -