📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "利军学生成绩管理系统V1.0"
ClientHeight = 2085
ClientLeft = 5865
ClientTop = 3855
ClientWidth = 3750
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1231.887
ScaleMode = 0 'User
ScaleWidth = 3521.047
ShowInTaskbar = 0 'False
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 3120
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 1080
Visible = 0 'False
Width = 1140
End
Begin VB.OptionButton Option2
Caption = "教师"
Height = 255
Left = 2160
TabIndex = 7
Top = 1080
Width = 855
End
Begin VB.OptionButton Option1
Caption = "学生"
Height = 255
Left = 840
TabIndex = 6
Top = 1080
Value = -1 'True
Width = 855
End
Begin VB.TextBox txtUserName
Height = 345
Left = 1290
TabIndex = 1
Top = 120
Width = 2325
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 390
Left = 495
TabIndex = 4
Top = 1500
Width = 1140
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 390
Left = 2100
TabIndex = 5
Top = 1500
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 345
IMEMode = 3 'DISABLE
Left = 1290
PasswordChar = "*"
TabIndex = 3
Top = 525
Width = 2325
End
Begin VB.Label lblLabels
Caption = "用户名称(&U):"
Height = 270
Index = 0
Left = 105
TabIndex = 0
Top = 150
Width = 1080
End
Begin VB.Label lblLabels
Caption = "密码(&P):"
Height = 270
Index = 1
Left = 105
TabIndex = 2
Top = 540
Width = 1080
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
End
End Sub
Private Sub cmdOK_Click()
On Error GoTo cuowu
If Option1.Value = True Then
Data1.RecordSource = "select pass from chengji where snum='" & txtUserName & "'"
Data1.Refresh
If Data1.Recordset.Fields("pass") = txtPassword Then
Me.Hide
Form1.Show
Else
MsgBox "无效的密码,请重试!", , "登录"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
Else
Data1.RecordSource = "select pass from teacher where tnum='" & txtUserName & "'"
Data1.Refresh
If Data1.Recordset.Fields("pass") = txtPassword Then
Me.Hide
Form2.Show
Else
MsgBox "无效的密码,请重试!", , "登录"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
End If
If Err.Number Then
cuowu: MsgBox "输入错误!", 48, "提示"
End If
End Sub
Private Sub Form_Load()
Dim mpath As String
mpath = App.Path
If Right(mpath, 1) <> "\" Then mpath = mpath + "\"
Data1.DatabaseName = mpath + "stu.mdb"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -