📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "张小省 03835015登录"
ClientHeight = 1530
ClientLeft = 2835
ClientTop = 3480
ClientWidth = 3480
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 903.974
ScaleMode = 0 'User
ScaleWidth = 3267.531
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txt_ManagerID
Height = 345
Left = 1080
MaxLength = 10
TabIndex = 1
Top = 120
Width = 2325
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 390
Left = 480
TabIndex = 3
Top = 1080
Width = 1140
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "退出"
Height = 390
Left = 1800
TabIndex = 4
Top = 1080
Width = 1140
End
Begin VB.TextBox txt_ManagerPass
Height = 345
IMEMode = 3 'DISABLE
Left = 1080
MaxLength = 10
PasswordChar = "*"
TabIndex = 2
Top = 600
Width = 2325
End
Begin VB.Label lbl_managerid
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "管理员ID:"
Height = 270
Left = 120
TabIndex = 0
Top = 240
Width = 930
End
Begin VB.Label lbl_managerpass
BackStyle = 0 'Transparent
Caption = "密 码:"
Height = 270
Left = 120
TabIndex = 5
Top = 720
Width = 930
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Option Explicit
Private Sub cmdCancel_Click()
End
End Sub
Private Sub cmdOK_Click()
Dim str_manager As String
str_manager = ""
If txt_ManagerID = "" Then
MsgBox "请输入管理员ID"
txt_ManagerID.SetFocus
Exit Sub
Else
str_manager = "select * from 管理员 where MANAGER_ID='" + txt_ManagerID + "' AND MANAGER_PASS='" + txt_ManagerPass + "'"
End If
If rds_manager.State = adStateOpen Then rds_manager.Close
rds_manager.Open str_manager, Module1.myconn, adOpenKeyset, adLockOptimistic, 1
If rds_manager.Fields(0) = txt_ManagerID Then
MDIMain.StatusBar1.Panels(2) = MDIMain.StatusBar1.Panels(2) & rds_manager.Fields("MANAGER_NAME")
Module1.manager_id = txt_ManagerID
rds_manager.Close
Unload frmLogin
MDIMain.Show
Else
MsgBox "无效的管理员ID密码,请重试!", vbCritical, "登录"
txt_ManagerID.SetFocus
txt_ManagerID.SelStart = 0
txt_ManagerID.SelLength = Len(txt_ManagerID)
rds_manager.Close
Exit Sub
End If
End Sub
Private Sub txt_ManagerID_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then SendKeys "{ENTER}"
End Sub
Private Sub txt_ManagerPass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then SendKeys "{ENTER}"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -