📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "中国人民银行管理员登录界面"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form2"
Picture = "Form1.frx":0000
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
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 = 375
Left = 3360
TabIndex = 6
Top = 2520
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3360
TabIndex = 5
Top = 1800
Width = 1095
End
Begin VB.TextBox Text2
Height = 375
Left = 1680
TabIndex = 4
Top = 1680
Width = 1095
End
Begin VB.TextBox Text1
Height = 375
Left = 1680
TabIndex = 3
Top = 960
Width = 1095
End
Begin VB.Label Label3
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "密码"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 2
Top = 1680
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "姓名"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 1
Top = 960
Width = 615
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "管理员登录"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 0
Top = 240
Width = 1815
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim sql As String
Dim rs_login As New ADODB.Recordset
Dim conn As New ADODB.Connection
conn.Open "provider=Microsoft.Jet.OLEDB.4.0; data source=中国银行.MDB"
If Trim(Text1.Text) = "" Or Trim(Text2.Text) = "" Then
MsgBox "用户名或密码不能为空,请重新输入!"
Text2.Text = ""
Text1.SetFocus
Exit Sub
End If '这是修改的代码 if end if 结尾,主要判断是否数人完整。
sql = "select * from 登录表 where 用户='" & Trim(Text1.Text) & "'"
rs_login.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_login.EOF = True Then
MsgBox "没有这个用户,请重输入!", vbOKOnly + vbExclamation, ""
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
If Trim(rs_login.Fields("密码")) = Trim(Text2.Text) Then
Unload Me
Form3.Show
Else
MsgBox "密码不正确,请重输入!", vbOKOnly + vbExclamation, ""
Text2.SetFocus
Text2.Text = ""
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -