📄 管理员登陆.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form guanliyuan
Caption = "管理员登陆界面"
ClientHeight = 5190
ClientLeft = 60
ClientTop = 450
ClientWidth = 6585
LinkTopic = "Form2"
ScaleHeight = 5190
ScaleWidth = 6585
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 615
Left = 2400
Top = 3720
Visible = 0 'False
Width = 1575
_ExtentX = 2778
_ExtentY = 1085
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton CmdOk
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 7
Top = 3120
Width = 975
End
Begin VB.CommandButton CmdCancel
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3960
TabIndex = 6
Top = 3120
Width = 975
End
Begin VB.TextBox TxtPassword
Height = 375
IMEMode = 3 'DISABLE
Left = 3000
PasswordChar = "*"
TabIndex = 5
Top = 2160
Width = 1815
End
Begin VB.TextBox TxtName
Height = 375
Left = 3000
TabIndex = 4
Top = 1440
Width = 1815
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1440
TabIndex = 3
Top = 2160
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "帐号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1440
TabIndex = 2
Top = 1440
Width = 720
End
Begin VB.Label Label4
Caption = "请输入账号和密码:"
BeginProperty Font
Name = "黑体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 1
Top = 840
Width = 2895
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "欢迎使用银行模拟系统"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = -240
TabIndex = 0
Top = 0
Width = 6975
End
End
Attribute VB_Name = "guanliyuan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public id As String
Private Sub CmdCancel_Click()
quanxian.Show
Unload Me
End Sub
Private Sub cmdOK_Click()
On Error GoTo ErrMsg
Dim SQL As String
If TxtName.Text = "" Or TxtPassword.Text = "" Then
MsgBox "请输入您的帐号和密码!", vbExclamation + vbOKOnly, "银行系统提示"
TxtName.Text = ""
TxtPassword.Text = ""
TxtName.SetFocus
Exit Sub
End If
Set adoCon = New ADODB.Connection
adoCon.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bank;Data Source=B14"
'与SQL后台数据库建立连接
SQL = ""
SQL = "select count(*) from admin_05_10 where name='" & Trim(TxtName.Text) & "' "
SQL = SQL & "and password='" & Trim(TxtPassword.Text) & "'"
Set adoRS = adoCon.Execute(SQL)
If adoRS(0) = 0 Then
MsgBox "您输入的帐号或密码有误,请重新输入!", vbOKOnly + vbExclamation, "银行系统提示"
TxtName.Text = ""
TxtPassword.Text = ""
TxtName.SetFocus
Exit Sub
End If
id = Trim(TxtName.Text)
Unload Me
guanli.Show
ErrMsg:
If Err.Number <> 0 Then
MsgBox CStr(Err.Number) + Err.Description, vbOKOnly + vbCritical, "错误提示"
Exit Sub
End If
End Sub
Private Sub Form_Load()
On Error GoTo ErrMsg
TxtName.Text = ""
TxtPassword.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 + -