📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "学生选课系统"
ClientHeight = 5580
ClientLeft = 2865
ClientTop = 1545
ClientWidth = 7065
LinkTopic = "Form1"
Picture = "Form1.frx":0000
ScaleHeight = 5580
ScaleWidth = 7065
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 1440
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 5040
Visible = 0 'False
Width = 3615
End
Begin VB.CommandButton CmdExit
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3000
TabIndex = 8
Top = 4320
Width = 1095
End
Begin VB.CommandButton CmdLogin
Caption = "登录"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
TabIndex = 7
Top = 4320
Width = 1095
End
Begin VB.TextBox TxtPass
Height = 375
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 6
Top = 3600
Width = 2295
End
Begin VB.TextBox TxtNumber
Height = 375
Left = 2160
TabIndex = 5
Top = 3000
Width = 2295
End
Begin VB.Label Label5
Caption = "密码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1200
TabIndex = 4
Top = 3720
Width = 615
End
Begin VB.Label Label4
Caption = "学号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1200
TabIndex = 3
Top = 3120
Width = 615
End
Begin VB.Label Label3
Caption = "请先登录"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2640
TabIndex = 2
Top = 2400
Width = 1335
End
Begin VB.Label Label2
Caption = "学生选课系统"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1920
TabIndex = 1
Top = 1320
Width = 2775
End
Begin VB.Label Label1
Caption = "欢 迎 进 入"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2040
TabIndex = 0
Top = 600
Width = 2535
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdExit_Click()
Unload Me
End Sub
Private Sub CmdLogin_Click()
Dim sql As String
If TxtNumber.Text <> "" And TxtPass.Text <> "" Then
sql = "select * from 学生信息 where 学号=" & " '" & TxtNumber.Text & " '"
End If
'连接数据库中的学生信息表
Data1.DatabaseName = App.Path & "\db1.mdb"
Data1.RecordSource = "select * from 学生信息 where 学号=" & " '" & TxtNumber.Text & " '"
Data1.Refresh
'判断该学生是否存在
'如果不存在则给出提示信息
'如果存在则进行其它操作
If Data1.Recordset.EOF Then
MsgBox ("对不起,您输入的学号不存在!请与管理员联系.")
TxtNumber.Text = ""
TxtPass.Text = ""
Else
If Data1.Recordset.Fields("密码") <> TxtPass.Text Then
MsgBox ("密码输入错误,请重新输入!")
'TxtNumber.Text = ""
TxtPass.Text = ""
Else
Form1.Show
MsgBox ("欢迎" & strStudentName & "欢迎使用选修课程管理系统" & Chr(13))
TxtNumber.Text = ""
TxtPass.Text = ""
Unload Me
FrmChoose.Show
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -