📄 form2.frm
字号:
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.ListBox List2
Height = 2220
Left = 2580
TabIndex = 6
Top = 360
Width = 1725
End
Begin VB.ListBox List1
Height = 2220
Left = 150
TabIndex = 5
Top = 360
Width = 1785
End
Begin VB.ListBox ListHZ
Height = 2220
Left = 4710
TabIndex = 0
Top = 360
Width = 1785
End
Begin MSAdodcLib.Adodc AdoFIXGrid
Height = 330
Left = 3150
Top = 4530
Visible = 0 'False
Width = 2385
_ExtentX = 4207
_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 = "AdoFIXGrid"
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 MSFlexGridLib.MSFlexGrid MSFlexGrid结果
Height = 4095
Left = 0
TabIndex = 1
Top = 2670
Width = 9945
_ExtentX = 17542
_ExtentY = 7223
_Version = 393216
Rows = 30
Cols = 30
FixedCols = 0
AllowBigSelection= 0 'False
FocusRect = 0
GridLinesFixed = 1
AllowUserResizing= 1
End
Begin CSCommandSCE.CommandSCE Cmmond2EXCEL
Height = 345
Left = 8310
TabIndex = 2
Top = 2220
Width = 1245
_ExtentX = 2196
_ExtentY = 609
Icon = "Form2.frx":0B5C
Caption = "输出结果"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ShowFocus = 0 'False
Appearance = 2
End
Begin CSCommandSCE.CommandSCE Command计算分析
Height = 345
Left = 6900
TabIndex = 3
Top = 2220
Width = 1245
_ExtentX = 2196
_ExtentY = 609
Icon = "Form2.frx":10F6
Caption = "计算分析"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ShowFocus = 0 'False
Appearance = 2
End
Begin CSCommandSCE.CommandSCE Command刷新科目列表
Height = 345
Left = 6900
TabIndex = 4
Top = 1740
Width = 1245
_ExtentX = 2196
_ExtentY = 609
Icon = "Form2.frx":1690
Caption = "刷新科目"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ShowFocus = 0 'False
Appearance = 2
End
Begin VB.Label Lab9
Caption = "参与当前考试的班级:"
Height = 255
Left = 2580
TabIndex = 9
Top = 90
Width = 1815
End
Begin VB.Label Lab10
Caption = "本考试中涉及的科目:"
Height = 255
Left = 180
TabIndex = 8
Top = 90
Width = 1845
End
Begin VB.Label Lab16
Caption = "欲参与汇总的班级:"
ForeColor = &H80000007&
Height = 285
Left = 4710
TabIndex = 7
Top = 90
Width = 1755
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub CommandIN_Click()
Dim I
For I = 0 To List2.ListCount - 1
ListHZ.AddItem List2.List(I)
Next I
End Sub
Private Sub CommandOUT_Click()
ListHZ.Clear
End Sub
Private Sub CommandSCE修改参数_Click()
If CommandSCE修改参数.Caption = "修改参数" Then
CommandSCE修改参数.Caption = "保存参数"
Command计算分析.Enabled = False
Cmmond2EXCEL.Enabled = False
Frame1.Enabled = True
TextSET(0).Enabled = True
TextSET(1).Enabled = True
TextSET(2).Enabled = True
Label1.Enabled = True
Label2.Enabled = True
Label3.Enabled = True
Label4.Enabled = True
Label5.Enabled = True
Label6.Enabled = True
Else
CommandSCE修改参数.Caption = "修改参数"
Command计算分析.Enabled = True
Cmmond2EXCEL.Enabled = True
Frame1.Enabled = False
TextSET(0).Enabled = False
TextSET(1).Enabled = False
TextSET(2).Enabled = False
Label1.Enabled = False
Label2.Enabled = False
Label3.Enabled = False
Label4.Enabled = False
Label5.Enabled = False
Label6.Enabled = False
End If
End Sub
Private Sub Command刷新科目列表_Click() '计算输出界面使用=======================
AdoHZ.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\db\svdb.mdb;Persist Security Info=False"
AdoHZ.RecordSource = "SELECT TOP 1 * FROM 成绩"
AdoHZ.Refresh
Dim I
If List1.ListCount <> 0 Then List1.Clear
For I = 5 To AdoHZ.Recordset.Fields.Count - 1
List1.AddItem Trim(AdoHZ.Recordset.Fields(I).Name)
Next
List2.Clear
ListHZ.Clear
End Sub
'===============================================
' 计算调用
Private Sub Command计算分析_Click()
If ListHZ.ListCount = 0 Then Exit Sub
If ListHZ.ListCount > 25 Then
MsgBox "本程序只提供最大对25个班级进行计算分析?请调整选择!", vbCritical + vbOKOnly, "超范围"
Exit Sub
End If
'If MsgBox("确定进行计算分析?", vbQuestion + vbOKCancel, "确认") = vbCancel Then Exit Sub
'
On Error Resume Next
Screen.MousePointer = 11
Form2EnableSet False
'预定义函数如下
Dim CountZF '班级Z分数
Dim CountStudents(29) As Integer '学生人数
Dim AVGfenshu(29) '平均分数
Dim AVGNj '年级平均分
Dim BZFenshu(29) '标准分数
Dim YouXiuS(29), JiGeS(29), ChaShengS(29)
Dim NJMaxFS, NJMinFS
CountZF = 0
NJMaxFS = 0
NJMinFS = 1000
Dim RowE
AdoFIXGrid.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\db\svdb.mdb;Persist Security Info=False"
With MSFlexGrid结果
.Clear
'===================== 重新设置表头
.Row = 0
.Col = 0: .Text = "班级"
.Col = 1: .Text = "教师"
.Col = 2: .Text = "与考"
.Col = 3: .Text = "平均分"
.Col = 4: .Text = "标准分"
.Col = 5: .Text = "Z分数"
.Col = 6: .Text = "优秀数"
.Col = 7: .Text = "优秀率%"
.Col = 8: .Text = "及格数"
.Col = 9: .Text = "及格率%"
.Col = 10: .Text = "差生数"
.Col = 11: .Text = "差生率%"
.Col = 12: .Text = "最高分"
.Col = 13: .Text = "最低分"
'================================================================= *******
For RowE = 1 To ListHZ.ListCount '开始(留表头空间)
.Row = RowE
'======== 班级
.Col = 0
.Text = ListHZ.List(RowE - 1)
'========================================================
.Col = 3 '平均分
AdoFIXGrid.RecordSource = "SELECT AVG([" & List1.Text & "]) FROM 成绩 WHERE 年级 LIKE '" & Left(ListHZ.List(RowE - 1), 4) & "' AND 班级 LIKE '" & Right(ListHZ.List(RowE - 1), 3) & "' AND [" & List1.Text & "] NOT IN ('/')"
AdoFIXGrid.Refresh
AVGfenshu(RowE) = Round(AdoFIXGrid.Recordset.Fields(0).Value, 2)
.Text = AVGfenshu(RowE)
'========================================================
.Col = 2 '与考人数
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -