📄 form4.frm
字号:
VERSION 5.00
Begin VB.Form Form4
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "登录"
ClientHeight = 3375
ClientLeft = 45
ClientTop = 435
ClientWidth = 4860
ForeColor = &H00000000&
LinkTopic = "Form4"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "Form4.frx":0000
ScaleHeight = 3375
ScaleWidth = 4860
StartUpPosition = 2 '屏幕中心
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "商品交易.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 960
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "系统信息"
Top = 2520
Visible = 0 'False
Width = 2415
End
Begin VB.CommandButton Command2
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2520
TabIndex = 5
Top = 1920
Width = 1455
End
Begin VB.CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "登录"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 480
TabIndex = 4
Top = 1920
Width = 1455
End
Begin VB.TextBox Text2
DataField = "密码"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
IMEMode = 3 'DISABLE
Left = 2520
PasswordChar = "*"
TabIndex = 3
Top = 1080
Width = 1695
End
Begin VB.TextBox Text1
DataField = "用户名"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 2520
TabIndex = 2
Top = 240
Width = 1695
End
Begin VB.Label Label3
Caption = "Label3"
Height = 15
Left = 3000
TabIndex = 6
Top = 600
Width = 135
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "输入密码"
DataSource = "Data1"
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 = 1695
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "输入用户名"
DataSource = "Data1"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 0
Top = 360
Width = 1815
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim micount As Integer
Private Sub Command1_Click()
Dim sqlstr As String
sqlstr = "select * from 系统信息 where 用户名='" & Text1.Text & "'"
Data1.RecordSource = sqlstr
Data1.Refresh
If Data1.Recordset.BOF Then
MsgBox "用户名错误,请重新输入!", vbCritical, "错误"
Text1.Text = " ": Text1.SetFocus
Else
If Data1.Recordset.Fields("密码") = Text2 Then
Unload Me
MDIForm1.Show
Else
MsgBox "密码错误,请重新输入!", vbCritical, "错误"
Text2.Text = "": Text2.SetFocus
End If
End If
micount = micount + 1
If micount = 3 Then
Unload Me
End If
End Sub
Private Sub Command2_Click()
Unload Me
Form2.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -