📄 form3.frm
字号:
VERSION 5.00
Begin VB.Form Form3
BackColor = &H8000000E&
Caption = "请登录计算器"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form3"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "C:\Documents and Settings\张琪\桌面\06090130张琪计算器\用户信息.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 240
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "计算器用户"
Top = 840
Visible = 0 'False
Width = 1140
End
Begin VB.CommandButton Command3
Caption = "退 出"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3240
TabIndex = 7
Top = 2400
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "注 册"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1800
TabIndex = 6
Top = 2400
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "登 录"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 360
TabIndex = 5
Top = 2400
Width = 1215
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 4
Top = 1800
Width = 2415
End
Begin VB.TextBox Text1
Height = 375
Left = 1680
TabIndex = 3
Top = 1200
Width = 2415
End
Begin VB.Label Label4
Caption = "label4"
DataField = "用户名"
DataSource = "Data1"
Height = 375
Left = 1320
TabIndex = 8
Top = 120
Visible = 0 'False
Width = 975
End
Begin VB.Label Label5
Caption = "label5"
DataField = "密码"
DataSource = "Data1"
Height = 375
Left = 2880
TabIndex = 9
Top = 120
Visible = 0 'False
Width = 975
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "密 码"
BeginProperty Font
Name = "华文中宋"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 2
Top = 1800
Width = 1095
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "用户名"
BeginProperty Font
Name = "华文中宋"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 1
Top = 1200
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "请 输 入"
BeginProperty Font
Name = "隶书"
Size = 36
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 975
Left = 720
TabIndex = 0
Top = 240
Width = 3495
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()
a = Text1.Text
b = Text2.Text
Data1.Recordset.FindFirst "用户名= '" & a & "'"
If a = Label4.Caption And b = Label5.Caption Then
Form3.Hide
Form1.Show
Else
x = MsgBox("用户或密码错误,请重新输入", , "提示")
Text1.Text = ""
Text1.Text = ""
Text1.SetFocus
End If
End Sub
Private Sub Command2_Click()
Unload Form3
Form4.Show
End Sub
Private Sub Command3_Click()
Unload Form3
End Sub
Private Sub Form_Load()
Dim newpath As String
newpath = App.Path
If Right(newpath, 1) <> "\" Then newpath = newpath + "\"
Data1.DatabaseName = newpath + "用户信息.mdb"
Data1.RecordSource = "计算器用户"
Data1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -