📄 form1_1.frm
字号:
VERSION 5.00
Begin VB.Form FormLOGIN
BorderStyle = 1 'Fixed Single
Caption = "登 录"
ClientHeight = 2220
ClientLeft = 5595
ClientTop = 3540
ClientWidth = 3990
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2220
ScaleWidth = 3990
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 495
Left = 2400
TabIndex = 5
Top = 1440
Width = 975
End
Begin VB.CommandButton Command1
Caption = "确 定"
Default = -1 'True
Height = 495
Left = 600
TabIndex = 4
Top = 1440
Width = 975
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 3
Top = 840
Width = 1935
End
Begin VB.TextBox Text1
Height = 375
Left = 1440
TabIndex = 1
Top = 480
Width = 1335
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密 码:"
Height = 180
Index = 1
Left = 600
TabIndex = 2
Top = 960
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "员工号:"
Height = 180
Index = 0
Left = 600
TabIndex = 0
Top = 600
Width = 720
End
End
Attribute VB_Name = "FormLOGIN"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public LoginSucceeded As Boolean
Private Sub command2_Click()
'设置全局变量为 false
'不提示失败的登录
LoginSucceeded = False
Me.Hide
End Sub
Private Sub command1_Click()
Set R = New ADODB.Recordset
Set C = New ADODB.Command
Set R2 = New ADODB.Recordset
Set C2 = New ADODB.Command
mm = Trim(Text1.Text)
YID (Trim(Text1.Text))
If Text2.Text = nn Then
msk1 = 2
C.ActiveConnection = J
C.CommandType = adCmdText
C.CommandText = "select Q from dbo.M where Y# = '" & mm & "';"
R.CursorLocation = adUseClient
R.Open C, , adOpenDynamic, adLockReadOnly
If Not R.EOF Then
msk = R!Q
Else
msk = 0
MsgBox "您还未得到任何权限!请与系统管理员联系", vbCritical, "警告"
End If
MDIForm1.MDIForm_Load
Unload Me
Else
MsgBox "密码错误!", , "警告"
Text2.SetFocus
SendKeys "{Home}+{End}"
End If
C.Cancel
Set R = Nothing
Set C = Nothing
H = Hour(Time)
M = Minute(Time)
S = Second(Time)
T = H & ":" & M & ":" & S
D = Day(Date)
Y = Year(Date)
M1 = Month(Date)
U = Y & "/" & M1 & "/" & D & "----" & T
Dim sssss As String
sssss = "insert into jx654.RZ values('" & mm & "','登录','" & U & "');"
' J.Execute sssss
End Sub
Public Sub YID(S As String)
Dim pwd As String
C2.ActiveConnection = x
C2.CommandType = adCmdText
C2.CommandText = "select M from dbo.M where Y# ='" & S & "';"
R2.CursorLocation = adUseClient
R2.Open C2, , adOpenDynamic, adLockReadOnly
If Not R2.EOF Then
nn = R2!M
Else
MsgBox "该用户不存在!", , "警告"
Text1.SetFocus
SendKeys "{Home}+{End}"
End If
R2.Close
C2.Cancel
Set R2 = Nothing
Set C2 = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -