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

📄 form5.frm

📁 一个教学管理系统,可以满足一般课程设计的要求
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form5 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "学生成绩查询"
   ClientHeight    =   5835
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   6615
   LinkTopic       =   "Form5"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   5835
   ScaleWidth      =   6615
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton Command1 
      Caption         =   "打印成绩单"
      Height          =   375
      Left            =   4080
      TabIndex        =   18
      Top             =   1440
      Width           =   1335
   End
   Begin VB.TextBox Text7 
      Height          =   375
      Left            =   1320
      TabIndex        =   16
      Top             =   1440
      Width           =   1455
   End
   Begin VB.TextBox Text6 
      Height          =   375
      Left            =   4560
      TabIndex        =   14
      Top             =   840
      Width           =   1455
   End
   Begin VB.TextBox Text5 
      Height          =   375
      Left            =   1320
      TabIndex        =   13
      Top             =   840
      Width           =   1455
   End
   Begin VB.TextBox Text4 
      Height          =   375
      Left            =   4560
      TabIndex        =   10
      Top             =   240
      Width           =   1455
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   1320
      TabIndex        =   8
      Top             =   240
      Width           =   1455
   End
   Begin VB.ListBox List1 
      Height          =   1680
      ItemData        =   "Form5.frx":0000
      Left            =   360
      List            =   "Form5.frx":0002
      TabIndex        =   6
      Top             =   2280
      Width           =   5655
   End
   Begin VB.CommandButton Command2 
      Caption         =   "查询"
      Height          =   375
      Left            =   4680
      TabIndex        =   0
      Top             =   4560
      Width           =   855
   End
   Begin VB.Frame Frame2 
      Caption         =   "按学生查询"
      Height          =   1095
      Left            =   360
      TabIndex        =   1
      Top             =   4200
      Width           =   5775
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   1080
         TabIndex        =   3
         Top             =   360
         Width           =   975
      End
      Begin VB.TextBox Text2 
         Height          =   375
         Left            =   3000
         TabIndex        =   2
         Text            =   "01086201"
         Top             =   360
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "姓名:"
         Height          =   255
         Left            =   480
         TabIndex        =   5
         Top             =   480
         Width           =   975
      End
      Begin VB.Label Label4 
         Caption         =   "学号:"
         Height          =   255
         Left            =   2400
         TabIndex        =   4
         Top             =   480
         Width           =   975
      End
   End
   Begin VB.Label Label8 
      Caption         =   "专    业:"
      Height          =   255
      Left            =   360
      TabIndex        =   17
      Top             =   1560
      Width           =   975
   End
   Begin VB.Label Label7 
      Caption         =   "年    龄:"
      Height          =   255
      Left            =   3600
      TabIndex        =   15
      Top             =   960
      Width           =   975
   End
   Begin VB.Label Label6 
      Caption         =   "性    别:"
      Height          =   255
      Left            =   360
      TabIndex        =   12
      Top             =   960
      Width           =   975
   End
   Begin VB.Label Label5 
      Caption         =   "课程成绩:"
      Height          =   255
      Left            =   360
      TabIndex        =   11
      Top             =   2040
      Width           =   975
   End
   Begin VB.Label Label2 
      Caption         =   "学    号:"
      Height          =   255
      Left            =   3600
      TabIndex        =   9
      Top             =   360
      Width           =   975
   End
   Begin VB.Label label1 
      Caption         =   "学生姓名:"
      Height          =   255
      Left            =   360
      TabIndex        =   7
      Top             =   360
      Width           =   975
   End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub Command2_Click()
Dim sql As String
Dim i As Integer
Dim rs_test As New ADODB.Recordset
  sql = "select * from student,choose,kecheng,lesson where  kecheng.l_id=lesson.l_id and choose.l_id=kecheng.l_id and choose.s_id=student.s_id and (student.s_id=" & "'" & Text2.Text & "'" & " or student.s_name=" & "'" & Text1.Text & "'" & ")"
Call Conn
rs_test.Open sql, Module1.conn_mdb, 3, 3
rs_test.MoveFirst
Text3.Text = rs_test("s_name")
Text4.Text = rs_test("s_id")
Text5.Text = rs_test("sex")
Text6.Text = rs_test("age")
Text7.Text = rs_test("class")
While (Not rs_test.EOF)
   s = s + rs_test("mark")
   List1.List(i) = "课程:" & rs_test("l_name") & "  成绩:" & rs_test("mark")
   rs_test.MoveNext
   i = i + 1
Wend
a = s / i
List1.List(i) = "—————————————————"
List1.List(i + 1) = "总分:" & s & "        平均分:" & a
Call conclose
End Sub

Private Sub Form_Load()
Dim sql As String
Dim i As Integer
Dim rs_test As New ADODB.Recordset
If Y = 3 Then
  sql = "select * from student,choose,kecheng,lesson where  kecheng.l_id=lesson.l_id and choose.l_id=kecheng.l_id and choose.s_id=student.s_id and student.s_id=" & id
  Call Conn
  rs_test.Open sql, Module1.conn_mdb, 3, 3
  rs_test.MoveFirst
  Text3.Text = rs_test("s_name")
  Text4.Text = rs_test("s_id")
  Text5.Text = rs_test("sex")
  While (Not rs_test.EOF)
    s = s + rs_test("mark")
    List1.List(i) = "课程:" & rs_test("l_name") & "  成绩:" & rs_test("mark")
    rs_test.MoveNext
    i = i + 1
  Wend
  a = s / i
  List1.List(i) = "—————————————————"
  List1.List(i + 1) = "总分:" & s & "        平均分:" & a
  Call conclose
  Frame2.Visible = False
  Label3.Visible = False
  Label4.Visible = False
  Text1.Visible = False
  Text2.Visible = False
  Command2.Visible = False
End If
End Sub

Private Sub Text1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
List1.Clear
End Sub

Private Sub Text2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
List1.Clear
End Sub

⌨️ 快捷键说明

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