📄 infofrm.frm
字号:
VERSION 5.00
Begin VB.Form infofrm
BorderStyle = 1 'Fixed Single
Caption = "个人信息确认"
ClientHeight = 3195
ClientLeft = 3825
ClientTop = 3330
ClientWidth = 4680
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
Begin VB.Frame Frame1
Height = 2535
Left = 120
TabIndex = 3
Top = 240
Width = 4455
Begin VB.Label infolab
Caption = "Label2"
Height = 735
Index = 7
Left = 120
TabIndex = 11
Top = 1680
Width = 4215
End
Begin VB.Label infolab
Caption = "Label2"
Height = 375
Index = 6
Left = 120
TabIndex = 10
Top = 1320
Width = 1935
End
Begin VB.Label infolab
Caption = "Label2"
Height = 375
Index = 5
Left = 2280
TabIndex = 9
Top = 960
Width = 1935
End
Begin VB.Label infolab
Caption = "Label2"
Height = 375
Index = 4
Left = 120
TabIndex = 8
Top = 960
Width = 1935
End
Begin VB.Label infolab
Caption = "Label2"
Height = 375
Index = 3
Left = 2280
TabIndex = 7
Top = 600
Width = 1935
End
Begin VB.Label infolab
Caption = "Label2"
Height = 375
Index = 2
Left = 120
TabIndex = 6
Top = 600
Width = 1935
End
Begin VB.Label infolab
Caption = "Label2"
Height = 375
Index = 1
Left = 2280
TabIndex = 5
Top = 240
Width = 1935
End
Begin VB.Label infolab
Caption = "Label2"
Height = 375
Index = 0
Left = 120
TabIndex = 4
Top = 240
Width = 1935
End
End
Begin VB.CommandButton Command2
Caption = "错误"
Height = 255
Left = 2520
TabIndex = 1
ToolTipText = "个人信息有错误"
Top = 2880
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "正确"
Height = 255
Left = 480
TabIndex = 0
ToolTipText = "个人信息准确无误"
Top = 2880
Width = 1575
End
Begin VB.Label Label1
Caption = "请核实确认您的个人信息"
BeginProperty Font
Name = "黑体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 720
TabIndex = 2
Top = 0
Width = 2895
End
End
Attribute VB_Name = "infofrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' 显示用户信息
Sub showinfo(ID As String)
Dim personInfo, courseinfo As Recordset
Dim sqlstr, str As String
' 读取学生个人基本信息
sqlstr = "select * from 学生信息 where 学号='" & ID & "'"
Set personInfo = courseDB.OpenRecordset(sqlstr, dbOpenSnapshot, dbReadOnly)
' 读取学生已选课程信息,这里只读取了课程名称
sqlstr = "SELECT [课程].[课程名称] "
sqlstr = sqlstr & " FROM 课程 INNER JOIN 学号课程 ON [课程].[课程编号]=[学号课程].[课程编号]"
sqlstr = sqlstr & " WHERE [学号课程].[学号]='" & ID & "'"
Set courseinfo = courseDB.OpenRecordset(sqlstr, dbOpenSnapshot, dbReadOnly)
' 在相应的标签控件中写入用户信息
For i = 0 To personInfo.Fields.Count - 1
infolab(i).Caption = personInfo.Fields(i).Name & " : " & personInfo.Fields(i).Value
Next
' 显示用户选修的课程名称
While Not (courseinfo.EOF)
str = str & " " & courseinfo.Fields("课程名称").Value
courseinfo.MoveNext
Wend
userName = CStr(personInfo.Fields("姓名").Value)
infolab(7).Caption = "选修课程: " & str
' 关闭记录集
personInfo.Close
courseinfo.Close
End Sub
' 用户确认后则隐藏该窗体
Private Sub Command1_Click()
infofrm.Hide
End Sub
' 如果信息有误,提示用户与相关教务人员联系,及时修改
Private Sub Command2_Click()
MsgBox "请与相关教务人员联系,及时修改", vbOKOnly, "提示"
infofrm.Hide
End Sub
' 每次窗体激活时,重新读取用户信息以便及时反映选课信息
Private Sub Form_Activate()
Call showinfo(ID)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -