📄 form2.frm
字号:
VERSION 5.00
Begin VB.Form Form2
BorderStyle = 3 'Fixed Dialog
Caption = "Form2"
ClientHeight = 1530
ClientLeft = 5475
ClientTop = 3975
ClientWidth = 3600
ControlBox = 0 'False
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "Form2.frx":0000
ScaleHeight = 1530
ScaleWidth = 3600
ShowInTaskbar = 0 'False
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "E:\qqiao\bysj\book.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 120
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "administrator"
Top = 1560
Width = 3375
End
Begin VB.TextBox Text1
DataField = "username"
DataSource = "Data1"
Height = 330
Left = 1320
TabIndex = 0
Top = 90
Width = 2175
End
Begin VB.TextBox Text2
DataField = "password"
DataSource = "Data1"
Height = 330
Left = 1320
TabIndex = 1
Top = 690
Width = 2175
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 1320
Picture = "Form2.frx":51EA
Style = 1 'Graphical
TabIndex = 2
Top = 1080
Width = 975
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2520
Picture = "Form2.frx":7CD1
Style = 1 'Graphical
TabIndex = 3
Top = 1080
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "管理员账号:"
Height = 255
Left = 120
TabIndex = 5
Top = 135
Width = 1095
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "管理员密码:"
Height = 255
Left = 120
TabIndex = 4
Top = 735
Width = 1095
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database
Dim rt As Recordset
Dim qq As String
Dim a, b As String
Dim c As Boolean
Dim i As Integer
Private Sub Command1_Click()
Form3.cmdadd.Visible = True
Form3.cmddel.Visible = True
Form3.cmdedit.Visible = True
Form3.cmdseek.Visible = True
Form3.cmdadd.Enabled = True
Form3.cmddel.Enabled = True
Form3.cmdedit.Enabled = True
Form3.cmdseek.Enabled = True
Form3.Text1.Enabled = True
Form3.Text2.Enabled = True
Form3.Text3.Enabled = True
Form3.Text4.Enabled = True
Form3.Text5.Enabled = True
Form3.Text6.Enabled = True
Form3.Text7.Enabled = True
Set db = OpenDatabase("E:\qqiao\bysj\book.mdb")
Set rt = db.OpenRecordset("administrator")
rt.MoveFirst
rt.Index = "username"
a = Text1.Text
rt.Seek "=", a
If i <> 2 Then
If rt.NoMatch = False Then
rt.Index = "password"
b = Text2.Text
rt.Seek "=", b
If rt.NoMatch = False Then
Form1.Hide
Form2.Hide
Form3.Show
Unload help
user.Hide
Else
qq = MsgBox("你不是管理员!请不要冒充!", vbOKCancel, "错误")
i = i + 1
If i = 2 Then MsgBox "你三次错误!本程序将自动关闭"
End If
Else
qq = MsgBox("你不是管理员!请不要冒充!", vbOKCancel, "错误")
i = i + 1
End If
Else
MsgBox "你三次错误!本程序将自动关闭"
End
End If
End Sub
Private Sub Command2_Click()
Form1.Show
Form2.Hide
Form3.Hide
Unload help
user.Hide
End Sub
Private Sub Form_Load()
Data1.Visible = False
Text1.Text = ""
Text2.Text = ""
Text2.PasswordChar = "*"
Form2.Caption = "管理员登陆"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -