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

📄 form1.frm

📁 这是个学生信息管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmSearch 
   Caption         =   "Form1"
   ClientHeight    =   5010
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6375
   LinkTopic       =   "Form1"
   ScaleHeight     =   5010
   ScaleWidth      =   6375
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command2 
      Caption         =   "返回"
      Height          =   495
      Left            =   2280
      TabIndex        =   6
      Top             =   4200
      Width           =   1815
   End
   Begin VB.CommandButton Command1 
      Caption         =   "查询学生成绩"
      Height          =   495
      Left            =   4200
      TabIndex        =   4
      Top             =   480
      Width           =   1815
   End
   Begin VB.Frame Frame2 
      Caption         =   "学生成绩信息"
      Height          =   2415
      Left            =   360
      TabIndex        =   3
      Top             =   1560
      Width           =   5655
      Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
         Height          =   2055
         Left            =   120
         TabIndex        =   5
         Top             =   240
         Width           =   5415
         _ExtentX        =   9551
         _ExtentY        =   3625
         _Version        =   393216
         Rows            =   100
         Cols            =   6
         FixedRows       =   9
         FixedCols       =   5
         FocusRect       =   0
         HighLight       =   0
         FillStyle       =   1
         ScrollBars      =   0
         SelectionMode   =   2
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   " 输入 "
      Height          =   855
      Left            =   360
      TabIndex        =   0
      Top             =   240
      Width           =   5775
      Begin VB.TextBox Text1 
         Height          =   270
         Left            =   1920
         TabIndex        =   2
         Top             =   360
         Width           =   1695
      End
      Begin VB.Label Label1 
         Caption         =   "请输入考试编号"
         Height          =   255
         Left            =   360
         TabIndex        =   1
         Top             =   360
         Width           =   1335
      End
   End
End
Attribute VB_Name = "frmSearch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
    Dim width
    Dim text
    Dim i
    Dim conn
    Dim rs
    Dim row
    Dim col
    Dim sql
    If (Text1.text = "") Then
        MsgBox ("没有输入课程号")
        Exit Sub
    End If
    exam_No = Text1.text

    
    Set conn = CreateObject("adodb.Connection")
    Set rs = CreateObject("adodb.Recordset")
    sql = "SELECT * FROM result_Info  where result_Info.exam_No='" & Text1.text & "'"
    conn.Open "student"
    rs.Open sql, conn, 1, 1
    row = 1
    If rs.EOF Then
        MsgBox ("没有找到相关记录")
        Exit Sub
    End If
    Do While Not rs.EOF
         MSFlexGrid1.TextMatrix(row, 0) = rs("exam_No")
         MSFlexGrid1.TextMatrix(row, 1) = rs("student_ID")
         MSFlexGrid1.TextMatrix(row, 2) = rs("student_Name")
         MSFlexGrid1.TextMatrix(row, 3) = rs("class_No")
         MSFlexGrid1.TextMatrix(row, 4) = rs("course_Name")
         MSFlexGrid1.TextMatrix(row, 5) = rs("result")
         row = row + 1
         rs.MoveNext
    Loop
    
    
End Sub

Private Sub Command2_Click()
  Unload Me
End Sub

Private Sub form_load()
    Dim text
    Dim width
    Dim i
    
    text = Array("考试编号", "学号", "姓名", "班号", "课程名", "分数")
    width = Array("8000", "8000", "8000", "8000", "8000", "8000")
    
    For i = 0 To 5
        MSFlexGrid1.width = CInt(width(i))
        MSFlexGrid1.TextMatrix(0, i) = text(i)
    Next
End Sub

⌨️ 快捷键说明

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