📄 form3.frm
字号:
VERSION 5.00
Begin VB.Form form3
BorderStyle = 0 'None
Caption = "系统登录"
ClientHeight = 4500
ClientLeft = 0
ClientTop = 0
ClientWidth = 6000
Icon = "Form3.frx":0000
LinkTopic = "Form3"
Picture = "Form3.frx":29C12
ScaleHeight = 4500
ScaleWidth = 6000
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Timer Timer1
Left = 5160
Top = 3360
End
Begin VB.CommandButton Command1
Caption = "Command1"
Default = -1 'True
Height = 495
Left = 4800
TabIndex = 3
Top = -3000
Width = 1215
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 2
Top = 2450
Width = 2055
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 2160
TabIndex = 0
Top = 1360
Width = 2055
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
BeginProperty Font
Name = "汉仪雪君体繁"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 495
Left = 2040
TabIndex = 1
Top = 1905
Width = 2055
End
Begin VB.Image Image2
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
Height = 375
Left = 3120
MouseIcon = "Form3.frx":4826E
MousePointer = 99 'Custom
Top = 3360
Width = 1335
End
Begin VB.Image Image1
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
Height = 375
Left = 1300
MouseIcon = "Form3.frx":483C0
MousePointer = 99 'Custom
Top = 3360
Width = 1335
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()
Call Image1_Click
End Sub
Private Sub Form_Load()
If rst.State = adStateOpen Then '在没有任何记录时启用
rst.Close
End If
rst.Open "select * from 个人信息", cnn, adOpenKeyset, adLockOptimistic, adCmdText
If rst.RecordCount = 0 Then
rst.AddNew
rst.Fields(0) = "0105222" '学号
rst.Fields(1) = "鲍文彬" '姓名
rst.Fields(2) = "xhlbwb" '密码
rst.Fields(3) = "男" '性别
rst.Fields(4) = "1985-2-20" '出生日期
rst.Fields(5) = "计算机业" '职业
rst.Fields(6) = "管理员管理" '单位
rst.Fields(7) = "2008-1-1" '借书证到期时间
rst.Fields(8) = "是" '是否特殊用户
rst.Fields(9) = "0" '己借书本数
rst.Fields(10) = "是" '是否为管理员
rst.Update
End If
If rst1.State = adStateOpen Then '借书批准
rst1.Close
End If
rst1.Open "select * from 系统", cnn, adOpenKeyset, adLockOptimistic, adCmdText
If rst1.RecordCount = 0 Then
rst1.AddNew
rst1.Fields(0) = "10"
rst1.Fields(1) = "15"
rst1.Fields(2) = "0105222"
rst1.Update
End If
End Sub
Private Sub Image1_Click()
Text1.Enabled = False
Text2.Enabled = False
If Text1.Text = "" Then
Text1.Enabled = True
Text2.Enabled = True
Text1.SetFocus
Exit Sub
End If
If rst.State = adStateOpen Then '借书批准
rst.Close
End If
rst.Open "select * from 个人信息 where 学号='" & Text1.Text & "'", cnn, adOpenKeyset, adLockOptimistic, adCmdText
If rst.EOF = True Then
MsgBox "输入学号有误,请检查后输入!", vbInformation, "学号错误"
Text1.Enabled = True
Text2.Enabled = True
Text1.SetFocus
Exit Sub
End If
If rst.Fields(2) = Text2.Text Then
Label1.Caption = rst.Fields(1)
idname = Label1.Caption
id = Text1.Text
id1 = Text1.Text
bookindex = rst.Fields(9)
If rst1.State = adStateOpen Then '借书批准
rst1.Close
End If
rst1.Open "select * from 系统", cnn, adOpenKeyset, adLockOptimistic, adCmdText
If rst.Fields(8) = "是" Then
systembooks = rst1.Fields(1)
Else
systembooks = rst1.Fields(0)
End If
If rst1.Fields(2) <> nonull Then
adminid = rst1.Fields(2)
End If
If rst.Fields(10) = "是" Then
admin = True
rst1.Fields(2) = rst.Fields(0)
rst1.Update
Else
admin = False
End If
Timer1.Interval = 2000
Exit Sub
Else
MsgBox "密码错误!", vbInformation
Text1.Enabled = True
Text2.Enabled = True
Text2.SetFocus
End If
End Sub
Private Sub Image2_Click()
End
End Sub
Private Sub Timer1_Timer()
Text2.Enabled = False
form3.Height = 0
form3.Width = 0
Timer1.Interval = 0
Load form1
form1.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -