📄 form2.frm
字号:
VERSION 5.00
Begin VB.Form Form2
BackColor = &H00FFFFFF&
Caption = "员工"
ClientHeight = 5895
ClientLeft = 60
ClientTop = 435
ClientWidth = 7980
LinkTopic = "Form2"
Picture = "Form2.frx":0000
ScaleHeight = 5895
ScaleWidth = 7980
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text2
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
IMEMode = 3 'DISABLE
Left = 3000
PasswordChar = "*"
TabIndex = 5
Top = 2040
Width = 2895
End
Begin VB.CommandButton Command2
BackColor = &H00C0E0FF&
Caption = "退出"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 975
Left = 4080
Style = 1 'Graphical
TabIndex = 3
Top = 3600
Width = 1935
End
Begin VB.CommandButton Command1
BackColor = &H00C0E0FF&
Caption = "进入"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 975
Left = 600
Style = 1 'Graphical
TabIndex = 2
Top = 3600
Width = 1935
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 3000
TabIndex = 1
Top = 840
Width = 4095
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00FFC0C0&
Caption = "密码"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 240
TabIndex = 4
Top = 2160
Width = 1455
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H00FFC0C0&
Caption = "操作帐号"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 240
TabIndex = 0
Top = 840
Width = 1575
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rst As New ADODB.Recordset
Dim rstl As New ADODB.Recordset
Private Sub Command1_Click()
con.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wuhao"
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "帐号或密码不能为空!", vbRetryCancel + vbExclamation, "错误"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
ElseIf Len(Text2.Text) < 6 Then
MsgBox "密码至少为6位", vbRetryCancel + vbExclamation, "错误"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
rs.Open "select worker_id,w_password from worker_xx053_19 where worker_id='" & Trim(Text1.Text) & "'and w_password='" & Trim(Text2.Text) & "'", con, adOpenKeyset, adLockOptimistic
If rs.EOF Then
MsgBox "帐号或密码错误", vbExclamation, "登陆错误"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
hello = rs.Sort
rs.MoveLast
MsgBox "登陆成功", vbExclamation
Unload Me
Form4.Show
con.Close
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
Form1.Show
End Sub
Private Sub Form_Load()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -