📄 loadform.frm
字号:
VERSION 5.00
Begin VB.Form LoadForm
BorderStyle = 1 'Fixed Single
Caption = "登录框"
ClientHeight = 2775
ClientLeft = 45
ClientTop = 330
ClientWidth = 4065
ForeColor = &H00000000&
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 2775
ScaleWidth = 4065
StartUpPosition = 2 '屏幕中心
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "E:\jp\vb\生日餐会系统\BSystem.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 360
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "用户"
Top = 240
Visible = 0 'False
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "退 出"
Height = 495
Left = 2280
TabIndex = 5
Top = 1920
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "登 录"
Height = 495
Left = 720
TabIndex = 4
Top = 1920
Width = 1095
End
Begin VB.Frame Frame1
Height = 2295
Left = 120
TabIndex = 1
Top = 360
Width = 3855
Begin VB.TextBox Text1
Height = 350
Left = 1320
TabIndex = 2
Top = 360
Width = 1935
End
Begin VB.TextBox Text2
Height = 350
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 3
Top = 945
Width = 1935
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "密码"
Height = 180
Left = 600
TabIndex = 7
Top = 1080
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "用户名"
Height = 180
Left = 600
TabIndex = 6
Top = 480
Width = 540
End
End
Begin VB.Label Label3
ForeColor = &H00808080&
Height = 255
Left = 1680
TabIndex = 0
Top = 120
Width = 2295
End
End
Attribute VB_Name = "LoadForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim strSQL As String
strSQL = "Select 用户名,用户密码,用户等级 from 用户 where 用户名 = '"
strSQL = strSQL & Text1.text & "' and 用户密码 = '" & Text2.text & "'"
Data1.RecordSource = strSQL
Data1.Refresh
If Data1.Recordset.RecordCount = 0 Then
MsgBox "用户名或密码不正确,请重新输入!", vbOKOnly, "错误"
LoadFormClearData
Text1.SetFocus
Exit Sub
End If
Data1.Recordset.MoveFirst
tyUserStru.sUserName = Data1.Recordset.Fields("用户名")
tyUserStru.sUserLev = Data1.Recordset.Fields("用户等级")
For i = 1 To JP_SET_USER_DJS
If tyUserStru.sUserLev >= i Then
strJPsetUserArray(i) = JP_SET_USER_ON
Else
strJPsetUserArray(i) = JP_SET_USER_OFF
End If
Next
Me.Hide
'''主窗体可以使用
MainForm.Enabled = True
MainForm.Show
RemindForm.Show
Unload Me
End Sub
Private Sub Command2_Click()
Data1.Database.Close
Unload Me
Unload MainForm
End Sub
Private Sub Form_Load()
Label3.Caption = JP_VERSION
Data1.DatabaseName = App.Path & "\BSystem.mdb"
End Sub
Private Sub LoadFormClearData()
Text1.text = ""
Text2.text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -