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

📄 tongji.frm

📁 主要用于学生的各方面信息的管理
💻 FRM
📖 第 1 页 / 共 3 页
字号:
            Alignment       =   1
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc Adodc4 
      Height          =   330
      Left            =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc3"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc5 
      Height          =   330
      Left            =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc3"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc8 
      Height          =   330
      Left            =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc3"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc9 
      Height          =   330
      Left            =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc3"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
End
Attribute VB_Name = "tongji"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False



Private Sub Combo1_Click()
Me.Adodc2.ConnectionString = cnn()
Adodc3.ConnectionString = cnn()
Adodc4.ConnectionString = cnn()
Me.Adodc5.ConnectionString = cnn()
Me.Adodc6.ConnectionString = cnn()
'找到符合专业条件的user
Me.Adodc2.RecordSource = "select user_id from Manage_user where user_major like '" & Combo1.Text & "%'"
Adodc2.Refresh
For j = 0 To Adodc2.Recordset.RecordCount - 1
u_id = Adodc2.Recordset.Fields("user_id")
Adodc3.RecordSource = "select *  from Manage_score where user_id =" & u_id
Adodc3.Refresh
For k = 0 To Adodc3.Recordset.RecordCount - 1
sub_id = Adodc3.Recordset.Fields("sub_id")
score_score = Adodc3.Recordset.Fields("score_score")
'find sub_record
Adodc4.RecordSource = "select * from Manage_subject where sub_id=" & sub_id
Adodc4.Refresh
sub_record = Adodc4.Recordset.Fields("sub_record")
sumone = score_score * sub_record
sumall = sumall + sumone
sc = sc + sub_record
Adodc3.Recordset.MoveNext
Next k

'删除数据库中的东西
Adodc5.RecordSource = "select * from Manage_sum where user_id=" & u_id
Adodc5.Refresh
For m = 0 To Adodc5.Recordset.RecordCount - 1
Adodc5.Recordset.Delete
Adodc5.Recordset.MoveNext
Next m
If Not Adodc5.Recordset.EOF Then
Adodc5.Recordset.MoveLast
Adodc5.Recordset.Update
End If
Adodc5.Recordset.AddNew
Adodc5.Recordset.Fields("user_id") = u_id
Adodc5.Recordset.Fields("score_ave") = sumall / sc

Adodc5.Recordset.Update
'Adodc5.Recordset.MoveNext

Adodc2.Recordset.MoveNext
 Next j
 


'绑定数据
Adodc7.ConnectionString = cnn()
Adodc7.RecordSource = "select Manage_user.user_name,Manage_subject.sub_name,Manage_score.score_score,Manage_sum.score_ave from Manage_score,Manage_user, Manage_sum,Manage_subject where Manage_score.user_id=Manage_sum.user_id and Manage_score.user_id=Manage_user.user_id and Manage_subject.sub_id=Manage_score.sub_id and Manage_user.user_major like '" & Combo1.Text & "%' order by score_ave desc"
Adodc7.Refresh
DataGrid1.Visible = True

End Sub



Private Sub Combo2_Click()
'变化了触发事件
'DataGrid2.ColumnHeaders ("课程id")
'DataGrid2.Columns.add ("课程名称")
'DataGrid2.Columns.add ("选修人数")
'DataGrid2.Columns.add ("重修人数")
'DataGrid2.Columns.add ("重修率")
'DataGrid2.Columns.add (4)
Adodc9.ConnectionString = cnn() '记录总的选修人数
Adodc10.ConnectionString = cnn() '记录重修人数
Adodc11.ConnectionString = cnn() '为寻找课程ID而用
Adodc11.RecordSource = "select sub_id from Manage_subject where sub_name='" & Combo2.Text & "'"
Adodc11.Refresh
sid = Adodc11.Recordset.Fields("sub_id")
Text1(0).Text = sid
Text1(1).Text = Combo2.Text
Adodc9.RecordSource = "select count (*) as cnt from Manage_score where score_score >= 60 and sub_id=" & sid
Adodc9.Refresh
Text1(2).Text = Adodc9.Recordset.Fields("cnt")
Adodc10.RecordSource = "select count (*) as cnt from Manage_renew where sub_id=" & sid
Adodc10.Refresh
Text1(3).Text = Adodc10.Recordset.Fields("cnt")
If Text1(2).Text <> 0 Then

Text1(4).Text = (Text1(3).Text / Text1(2).Text) * 100 & "%"
Else
Text1(4).Text = 0
End If

End Sub



Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Me.Adodc1.ConnectionString = cnn()
Adodc1.RecordSource = "select major_name from Manage_base"
Adodc1.Refresh
For i = 0 To Adodc1.Recordset.RecordCount - 1
a = Mid$(Adodc1.Recordset.Fields("major_name"), 1, InStr(2, Adodc1.Recordset.Fields("major_name"), "0") + 1)
'mid 从第一个开始 向后拿字符 instr找到第几个位置

If a = c Then
c = a
Adodc1.Recordset.MoveNext
Else
c = a
Me.Combo1.AddItem (a)
Adodc1.Recordset.MoveNext
End If
Next i

'重修率统计
Adodc8.ConnectionString = cnn()
Adodc8.RecordSource = "select sub_name from Manage_subject"
Adodc8.Refresh
For a = 0 To Adodc8.Recordset.RecordCount - 1
Combo2.AddItem (Adodc8.Recordset.Fields("sub_name"))
Adodc8.Recordset.MoveNext
Next a
End Sub

Private Sub TreeView1_BeforeLabelEdit(Cancel As Integer)

End Sub

Private Sub Text2_Change()

End Sub

Private Sub Text4_Change()

End Sub

⌨️ 快捷键说明

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