📄 登录.frm
字号:
VERSION 5.00
Begin VB.Form Form3
AutoRedraw = -1 'True
Caption = "登录"
ClientHeight = 4770
ClientLeft = 4170
ClientTop = 3135
ClientWidth = 7035
Icon = "登录.frx":0000
LinkTopic = "Form3"
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
Picture = "登录.frx":0442
ScaleHeight = 4770
ScaleWidth = 7035
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 405
Left = 3360
TabIndex = 5
Top = 1680
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3840
TabIndex = 4
Top = 3000
Width = 855
End
Begin VB.CommandButton Command1
Caption = "确定"
Default = -1 'True
Height = 375
Left = 2520
TabIndex = 3
Top = 3000
Width = 855
End
Begin VB.TextBox Text2
DataField = "name"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
IMEMode = 3 'DISABLE
Left = 3360
PasswordChar = "*"
TabIndex = 2
Text = "Text2"
Top = 2400
Width = 1455
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密 码:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 2040
TabIndex = 1
Top = 2400
Width = 1455
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户名:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 405
Left = 2040
TabIndex = 0
Top = 1680
Width = 1455
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i, j, a, b, c As Integer
Dim rs As New ADODB.Recordset
Private Sub Combo1_Change()
user = Combo1.Text
End Sub
Private Sub Command1_Click()
If Text2.Text = rs("密码") Then
Unload Me '关闭登录窗口
Form4.Show '显示主窗口
Unload Form1
Else
MsgBox "密码不正确,请重新输入!", 48, "提示"
Text2.SetFocus
Text2.Text = ""
i = i + 1
If i = 3 Then
MsgBox "您无权使用本系统,谢谢!"
End
End If
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Set con = New ADODB.Connection
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=gzgl.mdb;Persist Security Info=False"
con.CursorLocation = adUseClient
con.Open
mysql = "select * from 管理"
Randomize
Text2.Text = ""
Set rs = con.Execute(mysql)
For j = 0 To rs.RecordCount - 1
Combo1.AddItem rs.Fields(j).Value
Next
Combo1.Text = rs.Fields(0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set con = Nothing
Set rs = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -