⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmresultquery.frm

📁 学生管理系统,vb+acc开发的一个简单程序
💻 FRM
字号:
VERSION 5.00
Object = "{CE671F01-259E-40DA-92FE-95803E2ECBB5}#1.0#0"; "SmartXPButton.ocx"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form FrmResultQuery 
   BackColor       =   &H00E7DFE7&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "成绩信息查询"
   ClientHeight    =   5355
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   11460
   Icon            =   "FrmResultQuery.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   5355
   ScaleWidth      =   11460
   Begin VB.Frame Frame1 
      BackColor       =   &H00E7DFE7&
      Caption         =   "查询条件"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1980
      Left            =   120
      TabIndex        =   9
      Top             =   3240
      Width           =   11160
      Begin VB.TextBox txtExamNo 
         Height          =   400
         Left            =   6675
         TabIndex        =   2
         Top             =   360
         Width           =   1935
      End
      Begin VB.ComboBox cboClassNo 
         Height          =   300
         Left            =   3915
         TabIndex        =   1
         Top             =   435
         Width           =   1335
      End
      Begin VB.ComboBox cboCourseName 
         Height          =   300
         Left            =   6720
         TabIndex        =   5
         Top             =   1275
         Width           =   2415
      End
      Begin VB.ComboBox cboResult 
         Height          =   300
         Left            =   3915
         Style           =   2  'Dropdown List
         TabIndex        =   4
         Top             =   1275
         Width           =   1335
      End
      Begin VB.TextBox txtStudentId 
         Height          =   400
         Left            =   840
         TabIndex        =   0
         Top             =   360
         Width           =   1815
      End
      Begin VB.TextBox txtStudentName 
         Height          =   400
         Left            =   840
         TabIndex        =   3
         Top             =   1230
         Width           =   1815
      End
      Begin SmartXPButton.XpButton CmdQuery 
         Height          =   495
         Left            =   9600
         TabIndex        =   6
         Top             =   360
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   873
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Caption         =   "查找(&F)"
         CaptionMouseOverColor=   16711680
         PictureBackColor=   15790320
         PictureSmoothBackColor=   15790320
         ButtonPicture   =   "FrmResultQuery.frx":2CFA
      End
      Begin SmartXPButton.XpButton cmdExit 
         Height          =   495
         Left            =   9600
         TabIndex        =   7
         Top             =   1080
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   873
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Caption         =   "关闭(&E)"
         CaptionMouseOverColor=   16711680
         PictureBackColor=   15790320
         PictureSmoothBackColor=   15790320
         ButtonPicture   =   "FrmResultQuery.frx":50DC
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "分数:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   3240
         TabIndex        =   15
         Top             =   1320
         Width           =   525
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "姓名:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   240
         TabIndex        =   14
         Top             =   1320
         Width           =   525
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "课程名称:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   5640
         TabIndex        =   13
         Top             =   1320
         Width           =   945
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "学号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   240
         TabIndex        =   12
         Top             =   480
         Width           =   525
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "班号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   3240
         TabIndex        =   11
         Top             =   480
         Width           =   525
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "考试编号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   5640
         TabIndex        =   10
         Top             =   480
         Width           =   945
      End
   End
   Begin MSHierarchicalFlexGridLib.MSHFlexGrid ResultGrid 
      Height          =   2775
      Left            =   120
      TabIndex        =   8
      Top             =   120
      Width           =   11175
      _ExtentX        =   19711
      _ExtentY        =   4895
      _Version        =   393216
      BackColorFixed  =   15196135
      BackColorBkg    =   15196135
      BackColorUnpopulated=   15196135
      _NumberOfBands  =   1
      _Band(0).Cols   =   2
   End
End
Attribute VB_Name = "FrmResultQuery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim ResultQuery As OpenRs
Dim sql As String
Dim sql1 As String
Dim sql2 As String
Dim sql3 As String
Dim sql4 As String
Dim sql5 As String
Dim sql6 As String

Private Sub cboClassno_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If Not ((Chr(KeyAscii) <= "Z" And Chr(KeyAscii) >= "A") Or (Chr(KeyAscii) <= "9" And Chr(KeyAscii) >= "0") Or KeyAscii = 8) Then
    KeyAscii = 0
End If
End Sub

Private Sub cboCourseName_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then KeyAscii = 0
End Sub

Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub CmdQuery_Click()
sql = "select s.student_id,student_name,class_no,c.course_no,course_name,exam_no,result from result_info r inner join student_info s on r.student_id=s.student_id inner join course_info c on r.course_no=c.course_no where 1=1"
If txtStudentId.Text <> "" Then
    sql1 = "and s.student_id='" & txtStudentId.Text & "'"
Else
    sql1 = " "
End If

If txtStudentName.Text <> "" Then
    sql2 = "and student_name='" & txtStudentName.Text & "'"
Else
    sql2 = " "
End If

If cboClassNo.Text <> "" Then
    sql3 = "and class_no='" & cboClassNo.Text & "'"
Else
    sql3 = " "
End If

If cboResult.Text <> "" Then
    sql4 = "and result" & cboResult.Text
Else
    sql4 = " "
End If

If txtExamNo.Text <> "" Then
    sql5 = "and exam_no='" & txtExamNo.Text & "'"
Else
    sql5 = " "
End If

If cboCourseName.Text <> "" Then
    sql6 = "and course_name='" & cboCourseName.Text & "'"
Else
    sql6 = " "
End If
sql = sql & sql1 & sql2 & sql3 & sql4 & sql5 & sql6
ResultQuery.rsDK1 sql
If ResultQuery.rs1.EOF Then
    ResultGrid.Clear
    ResultGrid.FormatString = " |        学      号|      姓     名|班号|   课程编号|               课程名称|  考试编号|     分数"
    MsgBox "没有找到符合条件的记录!", vbOKOnly + vbInformation, "提示"
Else
    Set ResultGrid.DataSource = ResultQuery.rs1
    ResultGrid.FormatString = " |        学      号|      姓     名|班号|   课程编号|               课程名称|  考试编号|     分数"
End If
End Sub

Private Sub Form_Load()
Set ResultQuery = New OpenRs
ResultGrid.FormatString = " |        学      号|      姓     名|班号|   课程编号|               课程名称|  考试编号|     分数"
ResultQuery.rsDK1 "select s.student_id,student_name,class_no,c.course_no,course_name,exam_no,result from result_info r inner join student_info s on r.student_id=s.student_id inner join course_info c on r.course_no=c.course_no"
If ResultQuery.rs1.EOF Then
    ResultGrid.Clear
    ResultGrid.FormatString = " |        学      号|      姓     名|班号|   课程编号|               课程名称|  考试编号|     分数"
Else
    Set ResultGrid.DataSource = ResultQuery.rs1
    ResultGrid.FormatString = " |        学      号|      姓     名|班号|   课程编号|               课程名称|  考试编号|     分数"
End If

ResultQuery.rsDK1 "select * from class_info"
While Not ResultQuery.rs1.EOF
    cboClassNo.AddItem ResultQuery.rs1!Class_no
    ResultQuery.rs1.MoveNext
Wend

ResultQuery.rsDK1 "select distinct course_name from course_info"
While Not ResultQuery.rs1.EOF
    cboCourseName.AddItem ResultQuery.rs1!course_name
    ResultQuery.rs1.MoveNext
Wend

cboResult.AddItem ">=90"
cboResult.AddItem ">=80"
cboResult.AddItem ">=70"
cboResult.AddItem ">=60"
cboResult.AddItem "<60"
cboResult.AddItem ""
End Sub

Private Sub txtExamNo_KeyPress(KeyAscii As Integer)
If Not ((UCase(Chr(KeyAscii)) <= "Z" And UCase(Chr(KeyAscii)) >= "A") Or (Chr(KeyAscii) <= "9" And Chr(KeyAscii) >= "0") Or KeyAscii = 8) Then
    KeyAscii = 0
End If
End Sub

Private Sub txtStudentId_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If Not ((Chr(KeyAscii) <= "Z" And Chr(KeyAscii) >= "A") Or (Chr(KeyAscii) <= "9" And Chr(KeyAscii) >= "0") Or KeyAscii = 8) Then
    KeyAscii = 0
End If
End Sub

Private Sub txtstudentName_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then KeyAscii = 0
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -