📄 frmlog.frm
字号:
VERSION 5.00
Begin VB.Form frmLog
BackColor = &H00FFC0FF&
BorderStyle = 1 'Fixed Single
Caption = "登录"
ClientHeight = 3000
ClientLeft = 45
ClientTop = 435
ClientWidth = 4755
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3000
ScaleWidth = 4755
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdCansel
Caption = "取消"
Height = 375
Left = 2640
TabIndex = 7
Top = 2520
Width = 1095
End
Begin VB.CommandButton cmdOk
Caption = "确定"
Height = 375
Left = 1440
TabIndex = 6
Top = 2520
Width = 975
End
Begin VB.TextBox txtPwd
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000040&
Height = 390
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 5
Text = "admin"
Top = 1920
Width = 2295
End
Begin VB.TextBox txtName
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000040&
Height = 390
Left = 1440
TabIndex = 3
Text = "admin"
Top = 1320
Width = 2295
End
Begin VB.ComboBox cboType
Height = 315
ItemData = "frmLog.frx":0000
Left = 1560
List = "frmLog.frx":000D
Style = 2 'Dropdown List
TabIndex = 0
Top = 720
Width = 2055
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "密码"
Height = 255
Index = 2
Left = 840
TabIndex = 4
Top = 2040
Width = 375
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用户名*"
Height = 255
Index = 1
Left = 720
TabIndex = 2
Top = 1440
Width = 615
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "类型*"
Height = 255
Index = 0
Left = 840
TabIndex = 1
Top = 720
Width = 495
End
End
Attribute VB_Name = "frmLog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Sql As String
Dim RS As ADODB.Recordset
Private Sub cmdCansel_Click()
Unload Me
End Sub
Private Sub cmdOk_Click()
'登录
If Trim(Me.txtName.Text) <> "" Then
Sql = "select 密码 from 密码表 where 用户名='" & Trim(Me.txtName.Text)
Sql = Sql & "' and 类型='" & Trim(Me.cboType.Text) & "'"
Set RS = dbSelect(Sql)
If RS.EOF Then
MsgBox "无此用户!"
Else
If Me.txtPwd.Text = RS.Fields(0) Then
mdiMain.Show
If Me.cboType.Text = "管理员" Then
mdiMain.mnuSysSetUser.Visible = False
mdiMain.mnuSysDelUser.Visible = False
ElseIf Me.cboType.Text = "销售员" Then
mdiMain.mnuSysSetUser.Visible = False
mdiMain.mnuSysDelUser.Visible = False
mdiMain.mnuCheck.Visible = False
mdiMain.mnuReport.Visible = False
mdiMain.mnuSellReport.Visible = False
mdiMain.mnuSellDay.Visible = False
mdiMain.mnuSellCheck.Visible = False
mdiMain.mnuOther.Visible = False
Else
mdiMain.mnuReportUser.Visible = True
End If
mdiMain.Caption = "销售系统 " & "(当前用户:" & Format(Trim(Me.cboType.Text), "#####") & " " & Trim(Me.txtName.Text) & ")"
mdiMain.Tag = Trim(Me.txtName.Text)
Unload Me
Else
MsgBox "密码或者用户名不正确!"
Me.txtName.SetFocus
End If
End If
Else
MsgBox "用户名不能为空!"
Me.txtName.SetFocus
End If
End Sub
Private Sub Form_Load()
Me.cboType.ListIndex = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -