📄 查询成绩信息.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Form11
BackColor = &H00808080&
Caption = "查询成绩信息"
ClientHeight = 5265
ClientLeft = 60
ClientTop = 450
ClientWidth = 8100
LinkTopic = "Form11"
MDIChild = -1 'True
Picture = "查询成绩信息.frx":0000
ScaleHeight = 5265
ScaleWidth = 8100
WindowState = 2 'Maximized
Begin VB.Frame Frame1
BackColor = &H00E0E0E0&
Caption = "查询记录"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 1335
Left = 240
TabIndex = 1
Top = 3360
Width = 7335
Begin VB.CommandButton cmdexit
BackColor = &H00C0C0C0&
Caption = "退出查询"
Height = 375
Left = 5280
Style = 1 'Graphical
TabIndex = 10
Top = 840
Width = 1335
End
Begin VB.CommandButton cmdclear
BackColor = &H00C0C0C0&
Caption = "清 空"
Height = 375
Left = 2760
Style = 1 'Graphical
TabIndex = 9
Top = 840
Width = 1335
End
Begin VB.CommandButton cmdinquire
BackColor = &H00C0C0C0&
Caption = "查 询"
Height = 375
Left = 480
Style = 1 'Graphical
TabIndex = 8
Top = 840
Width = 1335
End
Begin VB.TextBox txtcourse
BackColor = &H00C0C0C0&
Height = 375
Left = 5880
TabIndex = 7
Top = 360
Width = 1215
End
Begin VB.TextBox txtname
BackColor = &H00C0C0C0&
Height = 375
Left = 3360
TabIndex = 6
Top = 360
Width = 1335
End
Begin VB.TextBox txtid
BackColor = &H00C0C0C0&
Height = 375
Left = 960
TabIndex = 5
Top = 360
Width = 1215
End
Begin VB.CheckBox chkcourse
BackColor = &H00E0E0E0&
Caption = "按课程"
Height = 375
Left = 4920
TabIndex = 4
Top = 360
Width = 975
End
Begin VB.CheckBox chkname
BackColor = &H00E0E0E0&
Caption = "按姓名"
Height = 375
Left = 2400
TabIndex = 3
Top = 360
Width = 1215
End
Begin VB.CheckBox chkid
BackColor = &H00E0E0E0&
Caption = "按学号"
Height = 375
Left = 120
TabIndex = 2
Top = 360
Width = 855
End
End
Begin MSFlexGridLib.MSFlexGrid msgflexGrid
Height = 3015
Left = 360
TabIndex = 0
Top = 120
Width = 7335
_ExtentX = 12938
_ExtentY = 5318
_Version = 393216
Rows = 9
Cols = 29
BackColor = 14737632
BackColorFixed = 8421504
BackColorBkg = 14737632
End
End
Attribute VB_Name = "Form11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdinquire_Click()
Dim txtsql As String
Dim msgtext As String
Dim dd(3) As Boolean
Dim mrc As Adodb.Recordset
msgflexGrid.Clear
txtsql = "select * from result_info where"
If chkid.Value = 1 Then
If Trim(txtid.Text = "") Then
FrmMain.StatusBarmy.Panels.Item(1).Text = "如果按学号查询,请输入学号"
txtid.SetFocus: Exit Sub
Else
If Not IsNumeric(Trim(txtid.Text)) Then
FrmMain.StatusBarmy.Panels.Item(1).Text = "学号必须是数字型"
txtid.SetFocus: Exit Sub
End If
dd(0) = True
txtsql = txtsql & " student_id = '" & Trim(txtid.Text) & " '"
End If
End If
If chkname.Value = 1 Then
If Trim(txtname.Text = "") Then
FrmMain.StatusBarmy.Panels.Item(1).Text = "如果按姓名查询,请输入姓名"
txtname.SetFocus: Exit Sub
Else
dd(1) = True
If dd(0) = True Then
txtsql = txtsql & "and student_name = '" & Trim(txtname.Text) & " '"
Else
txtsql = txtsql & " student_name = '" & Trim(txtname.Text) & " '"
End If
End If
End If
If chkcourse.Value = 1 Then
If Trim(txtcourse.Text = "") Then
FrmMain.StatusBarmy.Panels.Item(1).Text = "如果按班级查询,请输入班级"
txtcourse.SetFocus: Exit Sub
Else
dd(2) = True
If dd(0) = True Or dd(1) = True Then
txtsql = txtsql & "and course_name = '" & Trim(txtcourse.Text) & " '"
Else
txtsql = txtsql & " course_name = '" & Trim(txtcourse.Text) & " '"
End If
End If
End If
If Not (dd(0) Or dd(1) Or dd(2)) Then
FrmMain.StatusBarmy.Panels.Item(1).Text = "你还没有输入查询方式呢!"
txtid.SetFocus: Exit Sub
End If
txtsql = txtsql & "order by student_id"
Set mrc = executesql(txtsql, msgtext)
With msgflexGrid
.Row = 1
.CellAlignment = 4
.TextMatrix(0, 0) = "学生学号"
.TextMatrix(0, 1) = "学生姓名"
.TextMatrix(0, 2) = "班级编号"
.TextMatrix(0, 3) = "课程名称"
.TextMatrix(0, 4) = "分数"
.TextMatrix(0, 5) = "考试类型"
Do While Not mrc.EOF
.Row = .Row + 1
.TextMatrix(.Row - 1, 0) = mrc.Fields(0)
.TextMatrix(.Row - 1, 1) = mrc.Fields(1)
.TextMatrix(.Row - 1, 2) = mrc.Fields(2)
.TextMatrix(.Row - 1, 3) = mrc.Fields(3)
.TextMatrix(.Row - 1, 4) = mrc.Fields(4)
.TextMatrix(.Row - 1, 5) = mrc.Fields(5)
mrc.MoveNext
Loop
End With
mrc.Close
End Sub
Private Sub cmdexit_Click()
Me.Hide
End Sub
Private Sub Timer1_Timer()
If Label1.Left < Width Then
Label1.Left = Label1.Left + 40
Else
Label1.Left = 0
End If
End Sub
Private Sub Command2_Click()
msgflexGrid.Clear
End Sub
Private Sub cmdclear_Click()
msgflexGrid.Clear
chkid.Value = False
chkname.Value = False
chkcourse.Value = False
txtid.Text = ""
txtname.Text = ""
txtcourse.Text = ""
End Sub
Private Sub Form_Load()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -