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

📄 frmscoi.frm

📁 是VB做的学生信息管理系统,功能全面,界面美观
💻 FRM
📖 第 1 页 / 共 4 页
字号:
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "考试分数"
         Height          =   255
         Index           =   5
         Left            =   6600
         TabIndex        =   10
         Top             =   0
         Width           =   1335
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "学生编号"
         Height          =   255
         Index           =   4
         Left            =   3240
         TabIndex        =   8
         Top             =   0
         Width           =   1335
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "考试课程"
         Height          =   255
         Index           =   3
         Left            =   4920
         TabIndex        =   6
         Top             =   0
         Width           =   1335
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "学生班号"
         Height          =   255
         Index           =   2
         Left            =   1560
         TabIndex        =   4
         Top             =   0
         Width           =   1335
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "考试期号"
         Height          =   255
         Index           =   0
         Left            =   0
         TabIndex        =   3
         Top             =   0
         Width           =   1335
      End
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   4770
      Left            =   240
      TabIndex        =   0
      Top             =   960
      Width           =   8175
      _ExtentX        =   14420
      _ExtentY        =   8414
      _Version        =   393216
      Cols            =   4
      FixedCols       =   0
      BackColorFixed  =   14737632
      BackColorBkg    =   -2147483643
      Appearance      =   0
   End
   Begin VB.Label Label3 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      BorderStyle     =   1  'Fixed Single
      Caption         =   "           成    绩    信    息    列     表"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   375
      Left            =   240
      TabIndex        =   1
      Top             =   600
      Width           =   8175
   End
End
Attribute VB_Name = "frmscoi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mrc As ADODB.Recordset
Dim MsgText As String

Private Sub Combo1_Click(Index As Integer)
    Dim txSQL As String
    If Index = 0 Then
        txSQL = "select * from student_Form where student_Cla='" & Trim(Combo1(0).Text) & "'"
        Set mrc = ExecuteSQL(txSQL, MsgText)
        If mrc.EOF = True Then
            MsgBox "请先进行班级设置!", vbOKOnly, "提示"
        Else
            With Combo1(1)
                .Clear
                Do While Not mrc.EOF
                    .AddItem Trim(mrc!student_NO)
                    mrc.MoveNext
                Loop
            End With
        End If
        txSQL = "select * from class_Cour where class_NO='" & Trim(Combo1(0).Text) & "'"
        Set mrc = ExecuteSQL(txSQL, MsgText)
        If mrc.EOF = True Then
            MsgBox "请先进行班级设置!", vbOKOnly, "提示"
        Else
            With Combo1(2)
                .Clear
                Do While Not mrc.EOF
                    .AddItem Trim(mrc!course_Name)
                    mrc.MoveNext
                Loop
            End With
        End If
    End If
End Sub

Private Sub Combo2_Click(Index As Integer)
    Dim txSQL As String
    If Index = 0 Then
        txSQL = "select DISTINCT score_Stu from score_Form where score_Cla='" & Trim(Combo2(0).Text) & "'"
        Set mrc = ExecuteSQL(txSQL, MsgText)
        If mrc.EOF = False Then
            With Combo2(1)
                .Clear
                Do While Not mrc.EOF
                    .AddItem Trim(mrc!score_Stu)
                    mrc.MoveNext
                Loop
            End With
        End If
        txSQL = "select DISTINCT score_Cou from score_Form where score_Cla='" & Trim(Combo2(0).Text) & "'"
        Set mrc = ExecuteSQL(txSQL, MsgText)
        If mrc.EOF = False Then
            With Combo2(2)
                .Clear
                Do While Not mrc.EOF
                    .AddItem Trim(mrc!score_Cou)
                    mrc.MoveNext
                Loop
            End With
        End If
    End If
End Sub

Private Sub Combo3_Click(Index As Integer)
    Dim txSQL As String
    If Index = 0 Then
        txSQL = "select * from student_Form where student_Cla='" & Trim(Combo3(0).Text) & "'"
        Set mrc = ExecuteSQL(txSQL, MsgText)
        If mrc.EOF = False Then
            With Combo3(1)
                .Clear
                Do While Not mrc.EOF
                    If mrc!student_NO <> .Text Then
                        .AddItem Trim(mrc!student_NO)
                    End If
                    mrc.MoveNext
                Loop
            End With
        End If
        txSQL = "select * from class_Cour where class_NO='" & Trim(Combo3(0).Text) & "'"
        Set mrc = ExecuteSQL(txSQL, MsgText)
        If mrc.EOF = False Then
            With Combo3(2)
                .Clear
                Do While Not mrc.EOF
                    If mrc!course_Name <> .Text Then
                        .AddItem Trim(mrc!course_Name)
                    End If
                    mrc.MoveNext
                Loop
            End With
        End If
    End If
End Sub

Private Sub Command1_Click()
    Dim txtSQL As String
    If Text1(1) = "" Then
        MsgBox "考试期号不能为空!", vbOKOnly, "提示"
        Text1(1).SetFocus
        Exit Sub
    End If
    If Combo1(0).Text = "" Then
        MsgBox "学生班号不能为空!", vbOKOnly, "提示"
        Combo1(0).SetFocus
        Exit Sub
    End If
    If Combo1(1).Text = "" Then
        MsgBox "学生编号不能为空!", vbOKOnly, "提示"
        Combo1(1).SetFocus
        Exit Sub
    End If
    If Combo1(2).Text = "" Then
        MsgBox "考试课程不能为空!", vbOKOnly, "提示"
        Combo1(2).SetFocus
        Exit Sub
    End If
    If Text1(2) = "" Then
        MsgBox "考试分数不能为空!", vbOKOnly, "提示"
        Text1(2).SetFocus
        Exit Sub
    End If
    txtSQL = "select * from score_Form where score_Per='" & Trim(Text1(1)) & "' and score_Cla='" & Trim(Combo1(0).Text) & "' and score_Stu='" & Trim(Combo1(1).Text) & "'And score_Cou='" & Trim(Combo1(2).Text) & "'"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    If mrc.EOF = False Then
        MsgBox "同次同人同科只能添加一次", vbOKOnly, "警告"
        Text1(2) = ""
        Combo1(0).SetFocus
        Exit Sub
    End If
    txtSQL = "select * from score_Form"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    mrc.AddNew
    mrc.Fields(0) = Trim(Text1(0))
    mrc.Fields(1) = Trim(Text1(1))
    mrc.Fields(2) = Trim(Combo1(0).Text)
    mrc.Fields(3) = Trim(Combo1(1).Text)
    mrc.Fields(4) = Trim(Combo1(2).Text)
    mrc.Fields(5) = Trim(Text1(2))
    mrc.Update
    mrc.Close
    MsgBox "考试信息添加成功!", vbOKOnly, "提示"
    With MSFlexGrid1
        .Rows = .Rows + 1
        .TextMatrix(.Rows - 1, 0) = Trim(Text1(0))
        .TextMatrix(.Rows - 1, 1) = Trim(Text1(1))
        .TextMatrix(.Rows - 1, 2) = Trim(Combo1(0).Text)
        .TextMatrix(.Rows - 1, 3) = Trim(Combo1(1).Text)
        .TextMatrix(.Rows - 1, 4) = Trim(Combo1(2).Text)
        .TextMatrix(.Rows - 1, 5) = Trim(Text1(2))
    End With
    Text1(2) = ""
    Combo1(0).Clear
    txtSQL = "select * from class_Form"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    If mrc.EOF = False Then
        With Combo1(0)
            .Clear
            Do While Not mrc.EOF
                .AddItem Trim(mrc!class_NO)
                mrc.MoveNext
            Loop
        End With
    End If
    Combo1(1).Clear
    Combo1(2).Clear
    Text1(0) = GetRkno
    MSFlexGrid1.TopRow = MSFlexGrid1.Rows - 1
End Sub

Private Sub Command2_Click()
    Dim txtSQL As String
    Text1(0) = GetRkno
    Text1(1) = ""
    Text1(2) = ""
    Combo1(0).Clear
    txtSQL = "select * from class_Form"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    If mrc.EOF = False Then
        With Combo1(0)
            .Clear
            Do While Not mrc.EOF
                .AddItem Trim(mrc!class_NO)
                mrc.MoveNext
            Loop
        End With
    End If
    Combo1(1).Clear
    Combo1(2).Clear
End Sub

Private Sub Command3_Click()
    Dim j As Long
    Dim txtSQL As String
    Dim txSQL As String
    txtSQL = "select * from score_Form"
    If Text2(1) <> "" Then
        txtSQL = txtSQL & " where score_Per='" & Trim(Text2(1)) & "'"
    End If
    If Combo2(0).Text <> "" Then
        If txtSQL = "select * from score_Form" Then
            txtSQL = txtSQL & " where score_Cla='" & Trim(Combo2(0).Text) & "'"
        Else
            txtSQL = txtSQL & " And score_Cla='" & Trim(Combo2(0).Text) & "'"
        End If
    End If
    If Combo2(1).Text <> "" Then
        If txtSQL = "select * from score_Form" Then
            txtSQL = txtSQL & " where score_Stu='" & Trim(Combo2(1).Text) & "'"
        Else
            txtSQL = txtSQL & " And score_Stu='" & Trim(Combo2(1).Text) & "'"
        End If
    End If
    If Combo2(2).Text <> "" Then
        If txtSQL = "select * from score_Form" Then
            txtSQL = txtSQL & " where score_Cou='" & Trim(Combo2(2).Text) & "'"
        Else
            txtSQL = txtSQL & " And score_Cou='" & Trim(Combo2(2).Text) & "'"
        End If
    End If
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    j = 1
    Do While Not mrc.EOF
        j = j + 1
    mrc.MoveNext
    Loop
    ProgressBar1.Visible = True
    ProgressBar1.Min = CInt(0)
    ProgressBar1.Max = CInt(j)
    Set mrc = ExecuteSQL(txtSQL, MsgText)
        Frame1.Visible = True
        With MSFlexGrid1
        .Visible = False
        .Rows = 1
        ProgressBar1.Value = .Rows
        Do While Not mrc.EOF
            .Rows = .Rows + 1
            For i = 0 To mrc.Fields.Count - 1
                Select Case mrc.Fields(i).Type
                    Case adDBDate
                        .TextMatrix(.Rows - 1, i) = Format(mrc.Fields(i) & "", "yyyy-mm-dd")
                    Case Else
                        .TextMatrix(.Rows - 1, i) = mrc.Fields(i) & ""
                End Select
            Next i
            mrc.MoveNext
        Loop
        .Visible = True
        End With
        Frame1.Visible = False
    mrc.Close
    Text2(1) = ""
    txSQL = "select DISTINCT score_Cla from score_Form"
    Set mrc = ExecuteSQL(txSQL, MsgText)
    If mrc.EOF = False Then
        With Combo2(0)
            .Clear
            Do While Not mrc.EOF
                .AddItem Trim(mrc!score_Cla)

⌨️ 快捷键说明

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