📄 loginfrom.frm
字号:
VERSION 5.00
Begin VB.Form LoginFrom
Caption = "登陆企业管理系统"
ClientHeight = 4785
ClientLeft = 60
ClientTop = 420
ClientWidth = 8235
LinkTopic = "Form2"
ScaleHeight = 4785
ScaleWidth = 8235
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture1
AutoSize = -1 'True
Height = 1440
Left = 2520
Picture = "LoginFrom.frx":0000
ScaleHeight = 1380
ScaleWidth = 1500
TabIndex = 8
Top = 1080
Width = 1560
End
Begin VB.CommandButton Command2
Caption = "⊙"
Height = 375
Left = 120
TabIndex = 5
Top = 4200
Width = 375
End
Begin VB.CommandButton Command1
Caption = "登陆"
Default = -1 'True
Height = 735
Left = 6840
TabIndex = 4
Top = 1440
Width = 855
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 4920
PasswordChar = "*"
TabIndex = 3
Top = 1920
Width = 1815
End
Begin VB.TextBox Text1
Height = 270
Left = 4920
TabIndex = 2
Top = 1440
Width = 1815
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "企业管理系统"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 2880
TabIndex = 7
Top = 240
Width = 2610
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "退出本系统"
Height = 180
Left = 600
TabIndex = 6
Top = 4320
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "密码:"
Height = 180
Left = 4440
TabIndex = 1
Top = 1920
Width = 450
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "帐号:"
Height = 180
Left = 4440
TabIndex = 0
Top = 1440
Width = 450
End
Begin VB.Line Line3
X1 = 4080
X2 = 4080
Y1 = 1080
Y2 = 2520
End
Begin VB.Line Line2
X1 = 2520
X2 = 8280
Y1 = 2520
Y2 = 2520
End
Begin VB.Line Line1
X1 = 2520
X2 = 8280
Y1 = 1080
Y2 = 1080
End
End
Attribute VB_Name = "LoginFrom"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click() '登陆
'检测帐号密码是否为空
If Text1.Text = "" Then
MsgBox "帐号不能为空!", vbCritical, "登陆错误"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "密码不能为空!", vbCritical, "登陆错误"
Exit Sub
End If
'连接数据库
Set Ado_Conn = New ADODB.Connection
Set Ado_RS = New ADODB.Recordset
str_CS = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ManageSystem"
str_RS = "select * from BaseTable where BID='" & Trim(Text1.Text) & "'"
SqlConnect Ado_Conn, Ado_RS, str_CS, str_RS
'检测帐号是否存在
If Ado_RS.EOF = False Then '如果帐号存在
If Trim(Ado_RS.Fields("BID")) = Trim(Text1.Text) And Trim(Ado_RS.Fields("BPassword")) = Trim(Text2.Text) Then
ID = Trim(Ado_RS.Fields("BID"))
user_Position = Trim(Ado_RS.Fields("BPosition"))
Select Case Trim(Ado_RS.Fields("BPosition")) '检测权限
Case "总裁"
PresidentForm.Show
Case "人事经理"
ManagerFrom.Show
Case "经理"
ManagerFrom.Show
Case "维护部员工"
EmployeeFrom.Show
EmployeeFrom.Frame3.Visible = True
EmployeeFrom.Command6.Visible = True
Case "员工"
EmployeeFrom.Show
End Select
Unload Me
Else '帐号密码错误
MsgBox "帐号、密码错误,请重新输入!", vbCritical, "登陆错误"
End If
Else '如果帐号不存在
MsgBox "帐号不存在,请重新输入!", vbCritical, "登陆错误"
End If
'断开数据库连接
SqlDisConnect Ado_RS
End Sub
Private Sub Command2_Click() '退出
SureExit
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -