📄 frmlogon.frm
字号:
VERSION 5.00
Begin VB.Form frmLogon
BorderStyle = 1 'Fixed Single
Caption = "用户登录"
ClientHeight = 2220
ClientLeft = 36
ClientTop = 336
ClientWidth = 4140
BeginProperty Font
Name = "宋体"
Size = 10.8
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmLogon.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2220
ScaleWidth = 4140
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 1956
Left = 204
TabIndex = 0
Top = 84
Width = 3744
Begin VB.TextBox Text1
Height = 384
Left = 1656
TabIndex = 4
Top = 252
Width = 1656
End
Begin VB.TextBox Text2
Height = 384
IMEMode = 3 'DISABLE
Left = 1656
PasswordChar = "*"
TabIndex = 3
Top = 804
Width = 1656
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 408
Left = 1284
TabIndex = 2
Top = 1404
Width = 948
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 408
Left = 2340
TabIndex = 1
Top = 1416
Width = 948
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "用户名称"
Height = 216
Left = 600
TabIndex = 6
Top = 348
Width = 864
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "用户密码"
Height = 216
Left = 624
TabIndex = 5
Top = 888
Width = 864
End
End
End
Attribute VB_Name = "frmLogon"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim sql As String
Dim Rs As New ADODB.Recordset
sql = "select * from users where name='" & Text1.Text & "'"
Rs.open sql, dbcon, adOpenKeyset, adLockOptimistic, adCmdText
If Rs.EOF And Rs.BOF Then
MsgMsg "无此用户!"
Exit Sub
End If
If Rs("pwd") <> GetHash(Text2.Text) Then
MsgMsg "密码不正确!"
Exit Sub
End If
Rs.Close
frmLeft.Show
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error GoTo lab
Dim scon As String
scon = "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.Path & "\TK.mdb"
p_conn = scon
dbcon.open scon
Exit Sub
lab:
MsgMsg "数据库打开错误!"
MsgMsg Err.Description
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -