📄 login.frm
字号:
VERSION 5.00
Begin VB.Form Login
Caption = "系统登陆 "
ClientHeight = 3315
ClientLeft = 60
ClientTop = 450
ClientWidth = 5370
LinkTopic = "Form1"
ScaleHeight = 3315
ScaleWidth = 5370
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdCreat
Caption = "新开户"
Height = 495
Left = 4080
TabIndex = 7
Top = 1080
Width = 1095
End
Begin VB.CommandButton cmdExit
Caption = "退出"
Height = 495
Left = 3240
TabIndex = 6
Top = 2520
Width = 975
End
Begin VB.CommandButton cmdOk
Caption = "登录"
Height = 495
Left = 1080
TabIndex = 5
Top = 2520
Width = 975
End
Begin VB.TextBox passwd
Height = 375
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 4
Top = 1800
Width = 2655
End
Begin VB.TextBox user
Height = 375
Left = 1200
TabIndex = 2
Top = 1080
Width = 2655
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "密码:"
Height = 255
Left = 600
TabIndex = 3
Top = 1920
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "帐号:"
Height = 375
Left = 600
TabIndex = 1
Top = 1080
Width = 735
End
Begin VB.Label Label1
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 = 735
Left = 960
TabIndex = 0
Top = 360
Width = 3495
End
End
Attribute VB_Name = "Login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public id As String
Private Sub cmdOK_Click()
On Error GoTo ErrMsg
Dim SQL As String
If user.Text = "" Or passwd.Text = "" Then
MsgBox "请输入您的帐号和密码!", vbExclamation + vbOKOnly, "系统提示"
user.Text = ""
passwd.Text = ""
user.SetFocus
Exit Sub
End If
Call connectDB
SQL = ""
SQL = "select count(*) from 银行表 where 帐号='" & Trim(user.Text) & "' "
SQL = SQL & "and 密码='" & Trim(passwd.Text) & "'"
Set adoRS = adoCon.Execute(SQL)
If adoRS(0) = 0 Then
MsgBox "您输入的帐号或密码有误,请重新输入", vbOKOnly + vbExclamation, "系统提示"
user.Text = ""
passwd.Text = ""
user.SetFocus
Exit Sub
End If
id = Trim(user.Text)
Unload Me
Main.Show
ErrMsg:
If Err.Number <> 0 Then
MsgBox CStr(Err.Number) + Err.Description, vbOKOnly + vbCritical, "错误提示"
Exit Sub
End If
End Sub
Private Sub cmdExit_Click()
If MsgBox("您要退出本系统吗?", vbYesNo + vbQuestion, "系统提示") = vbYes Then
Unload Me
End If
End Sub
Private Sub cmdCreat_Click()
creat.Show
Unload Me
End Sub
Private Sub Form_Load()
On Error GoTo ErrMsg
user.Text = ""
passwd.Text = ""
ErrMsg:
If Err.Number <> 0 Then
MsgBox Err.Number & Err.Description, vbOKOnly + vbCritical, "出错提示"
Exit Sub
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -