📄 form3.frm
字号:
VERSION 5.00
Begin VB.Form Form3
Caption = "职工"
ClientHeight = 6660
ClientLeft = 120
ClientTop = 420
ClientWidth = 8910
LinkTopic = "Form3"
ScaleHeight = 6660
ScaleWidth = 8910
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "返回"
Height = 615
Left = 5040
TabIndex = 5
Top = 3840
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 615
Left = 3120
TabIndex = 4
Top = 3840
Width = 1215
End
Begin VB.TextBox Text2
Height = 495
IMEMode = 3 'DISABLE
Left = 3240
PasswordChar = "*"
TabIndex = 3
Top = 2640
Width = 2535
End
Begin VB.TextBox Text1
Height = 495
Left = 3240
TabIndex = 2
Top = 1560
Width = 2535
End
Begin VB.Label Label3
Caption = "5位"
Height = 255
Left = 6240
TabIndex = 6
Top = 1680
Width = 735
End
Begin VB.Label Label2
Caption = "密码"
Height = 255
Left = 1920
TabIndex = 1
Top = 2760
Width = 975
End
Begin VB.Label Label1
Caption = "职工号"
Height = 255
Left = 1920
TabIndex = 0
Top = 1680
Width = 855
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click() '进出操作员界面
Set rs = New ADODB.Recordset
cmd.CommandType = adCmdText
cmd.CommandText = "select employee_id,employee_secret_code from xinxi0504_23_employee " + _
"where employee_id= " & Trim(Text1.Text) & " and authority='职工'"
Set rs = cmd.Execute
If rs.EOF = True Then
MsgBox "用户名不存在"
Text1.Text = ""
Text2.Text = ""
ElseIf Text2.Text <> Trim(rs.Fields("employee_secret_code")) Then
MsgBox "密码错误"
Text2.Text = ""
Else:
employee_id = rs.Fields("employee_id")
Form11.Show
Unload Form3
End If
End Sub
Private Sub Command2_Click()
conn.Close
Form1.Show
Unload Form3
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text2.PasswordChar = "*"
Call connection_sql
End Sub
Private Sub Text1_LostFocus()
If Len(Text1.Text) <> 5 Then
MsgBox "账号长度不对"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -