📄 登陆.frm
字号:
Width = 900
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 1680
Top = 2280
Visible = 0 'False
Width = 2295
_ExtentX = 4048
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Bookdate;Data Source=127.0.0.1"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Bookdate;Data Source=127.0.0.1"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = "sa"
Password = ""
RecordSource = "Manage_User"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin dlocx.XPFrame frameDengLu
Height = 1335
Left = 120
TabIndex = 20
Top = 0
Width = 4455
_ExtentX = 7858
_ExtentY = 2355
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontName = "宋体"
FontSize = 9
FontBold = 0 'False
FontItalic = 0 'False
Begin VB.TextBox txtpass
Appearance = 0 'Flat
ForeColor = &H000080FF&
Height = 270
IMEMode = 3 'DISABLE
Left = 2160
MaxLength = 15
PasswordChar = "*"
TabIndex = 3
Top = 555
Width = 2175
End
Begin VB.TextBox TxtUser
Appearance = 0 'Flat
ForeColor = &H000080FF&
Height = 270
IMEMode = 3 'DISABLE
Left = 2160
MaxLength = 15
TabIndex = 2
Top = 240
Width = 2175
End
Begin dlocx.xpcmdbutton CmdOk
Height = 255
Left = 3240
TabIndex = 4
Top = 960
Width = 855
_ExtentX = 1508
_ExtentY = 450
Caption = "确定进入"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin dlocx.xpcmdbutton CmdExit
Height = 255
Left = 1680
TabIndex = 5
Top = 960
Width = 975
_ExtentX = 1720
_ExtentY = 450
Caption = "取消退出"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户名称:"
Height = 180
Left = 1200
TabIndex = 22
Top = 240
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "登陆密码:"
Height = 180
Left = 1200
TabIndex = 21
Top = 600
Width = 900
End
Begin VB.Image Image2
Height = 780
Left = 240
Picture = "登陆.frx":059F
Top = 240
Width = 780
End
End
End
Attribute VB_Name = "frmlogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim CountLogin%, OptQx%
Private Sub CmdExit_Click()
End
End Sub
Private Sub CmdOk_Click()
'On Error GoTo err
If Trim(TxtUser) = "" Or Trim(TxtPass) = "" Then
MsgBox "密码或用户名不能为空", vbOKOnly + vbInformation, "用户切换提示"
TxtUser = ""
TxtPass = ""
Exit Sub
Else
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from Manage_User where username='" + Trim(TxtUser.Text) + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "没有此用户", vbOKOnly, "错误"
TxtUser = ""
TxtPass = ""
TxtUser.SetFocus
Exit Sub
End If
user = Adodc1.Recordset.Fields(1)
pass = Adodc1.Recordset.Fields(2)
QX = Adodc1.Recordset.Fields(3)
If user = TxtUser And pass = TxtPass Then
frmtime.Show
Unload Me
Else
If CountLogin >= 3 Then
MsgBox "您已经三次输入错误,系统将自动退出", vbOKOnly + vbExclamation, "错误"
End
Else
MsgBox "密码错误,请向管理员查询!", vbOKOnly + vbInformation, "登陆提示"
TxtUser = ""
TxtPass = ""
TxtUser.SetFocus
CountLogin = CountLogin + 1
End If
End If
End If
'err:
' MsgBox err.Description
End Sub
Private Sub CmdQueDing_Click()
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from Manage_User"
Adodc1.Refresh
Dim n%
For n = 1 To Adodc1.Recordset.RecordCount
If DcbEmpName.Text = Adodc1.Recordset.Fields("emp_name") Then
MsgBox "该员工已经是系统用户了", vbInformation, "添加用户提示"
Call Info
Exit Sub
Else
Adodc1.Recordset.MoveNext
End If
Next n
'判断添加的用户权限
If OptChaoJi.Value Then
OptQx = 1
ElseIf OptPuTong.Value Then
OptQx = 2
Else
OptQx = 3
End If
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("emp_name") = DcbEmpName.Text
Adodc1.Recordset.Fields("username") = TxtUser2
Adodc1.Recordset.Fields("password") = TxtPass2
Adodc1.Recordset.Fields("quanxian") = OptQx
Adodc1.Recordset.Update
' Adodc2.CommandType = adCmdText
' Adodc2.RecordSource = "select * from employee"
' Adodc2.Refresh
' For n = 1 To Adodc2.Recordset.RecordCount
' If Adodc2.Recordset.Fields("emp_name") = DcbEmpId.Text Then
' Adodc2.Recordset.Update "emp_name", TxtPassQR
'
' Else
' Adodc2.Recordset.MoveNext
' End If
' Next n
Unload Me
MsgBox "添加用户成功", vbOKOnly, "成功"
End Sub
Private Sub Command5_Click()
Unload Me
End Sub
Private Sub Command6_Click()
Call Info
End Sub
Private Sub Form_Load()
CountLogin = 0
frameXinJian.Visible = False
frameDengLu.Visible = True
'CmdXinJian.Visible = True
CmdExit.Visible = True
CmdOk.Visible = True
frmlogin.Height = 1900
frmlogin.Width = 4770
End Sub
Private Sub OptZhiDu_Click()
If OptChaoJi.Value Then
OptQx = 1
ElseIf OptPuTong.Value Then
OptQx = 2
Else
OptQx = 3
End If
End Sub
Private Sub Info()
TxtUser2.Text = ""
TxtPass2.Text = ""
TxtPassQR.Text = ""
TxtUser2.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -