📄 frmfors.frm
字号:
VERSION 5.00
Begin VB.Form frmForSC
Caption = "frmForSC"
ClientHeight = 4395
ClientLeft = 4440
ClientTop = 2430
ClientWidth = 6390
LinkTopic = "Form1"
ScaleHeight = 4395
ScaleWidth = 6390
Begin VB.CommandButton cmdExit
Caption = "退出"
Height = 495
Left = 4680
TabIndex = 8
Top = 3720
Width = 1215
End
Begin VB.CommandButton cmdContinu
Caption = "继续查询"
Height = 495
Left = 3000
TabIndex = 7
Top = 3720
Width = 1215
End
Begin VB.TextBox txtGrade
Height = 495
Left = 2760
TabIndex = 6
Top = 2520
Width = 2175
End
Begin VB.CommandButton cmdSearch
Caption = "查询"
Height = 495
Left = 1200
TabIndex = 4
Top = 3720
Width = 1215
End
Begin VB.TextBox txtCname
Height = 495
Left = 2760
TabIndex = 3
Top = 1560
Width = 2175
End
Begin VB.TextBox txtSname
Height = 495
Left = 2760
TabIndex = 2
Top = 600
Width = 2175
End
Begin VB.Label Label1
Caption = "成绩:"
Height = 495
Left = 1440
TabIndex = 5
Top = 2520
Width = 1215
End
Begin VB.Label Label3
Caption = "课程:"
Height = 495
Left = 1440
TabIndex = 1
Top = 1560
Width = 1215
End
Begin VB.Label Label2
Caption = "姓名:"
Height = 495
Left = 1440
TabIndex = 0
Top = 600
Width = 1215
End
End
Attribute VB_Name = "frmForSC"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdContinu_Click()
txtCname.Text = ""
txtSname = ""
txtGrade = ""
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdSearch_Click()
Dim rstS As New ADODB.Recordset
Dim rstC As New ADODB.Recordset
Dim rstSC As New ADODB.Recordset
Dim sqlS As String
Dim sqlC As String
Dim sqlSC As String
Dim Sno As String
Dim Cno As String
sqlS = "select * from student where sname='" & txtSname.Text & "';"
sqlC = "select * from course where cname='" & txtCname.Text & "';"
rstS.Open sqlS, cn, adOpenStatic
Sno = rstS!Sno
rstS.Close
Set rstS = Nothing
rstC.Open sqlC, cn, adOpenStatic
Cno = rstC!Cno
rstC.Close
Set rstC = Nothing
sqlSC = "select * from sc where sno=" & Sno & " and cno=" & Cno & ";"
rstSC.Open sqlSC, cn, adOpenStatic
txtGrade.Text = rstSC!grade
rstSC.Close
Set rstSC = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -