📄 zp.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form zp
BorderStyle = 3 'Fixed Dialog
Caption = "学期综合评定--[学习成绩+平时成绩]"
ClientHeight = 7620
ClientLeft = 45
ClientTop = 435
ClientWidth = 11760
Icon = "zp.frx":0000
LinkTopic = "Form3"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7620
ScaleWidth = 11760
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 615
Left = 0
TabIndex = 5
Top = 0
Width = 11760
_ExtentX = 20743
_ExtentY = 1085
ButtonWidth = 820
ButtonHeight = 926
Appearance = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 2
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "升序"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "降序"
ImageIndex = 2
EndProperty
EndProperty
Begin MSComctlLib.ImageList ImageList1
Left = 5400
Top = 240
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "zp.frx":08CA
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "zp.frx":2A04
Key = ""
EndProperty
EndProperty
End
End
Begin VB.Frame Frame1
Caption = "tre"
Height = 1455
Left = 0
TabIndex = 0
Top = 6840
Width = 11775
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 9240
TabIndex = 4
Top = 240
Width = 855
End
Begin VB.CommandButton Command1
Caption = "查询"
Height = 375
Left = 6000
TabIndex = 3
Top = 240
Width = 975
End
Begin VB.Frame Frame4
Caption = "学期:"
Height = 615
Left = 0
TabIndex = 1
Top = 0
Width = 3015
Begin VB.ComboBox Combo1
BackColor = &H80000018&
Height = 300
Index = 3
ItemData = "zp.frx":4B3E
Left = 840
List = "zp.frx":4B57
TabIndex = 2
Text = "大一上学期"
Top = 200
Width = 2055
End
End
End
Begin MSFlexGridLib.MSFlexGrid MSF1
Bindings = "zp.frx":4BAF
Height = 6975
Left = 0
TabIndex = 6
Top = 600
Width = 11775
_ExtentX = 20770
_ExtentY = 12303
_Version = 393216
FixedCols = 0
BackColor = 16777215
ForeColor = 0
BackColorFixed = 8421504
ForeColorFixed = 0
ForeColorSel = 16777215
AllowUserResizing= 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
Attribute VB_Name = "zp"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click(Index As Integer)
MSF1.Clear
End Sub
Private Sub Command1_Click()
Dim mrc1 As ADODB.Recordset
Dim mrc2 As ADODB.Recordset
Dim mrc3 As ADODB.Recordset
Dim mrc4 As ADODB.Recordset
Dim g As Integer
Dim sum As Single
txtSQL = "select 学分 from course inner join zpcourse on course.课程名称=zpcourse.课程名称 where zpcourse.学期='" & Trim(Combo1(3).Text) & "'"
Set mrc3 = ExecuteSQL(txtSQL)
If mrc3.EOF = True Then
Exit Sub
Else
End If
Dim total As Single
total = 0
Do While Not mrc3.EOF
total = total + mrc3.Fields(0)
mrc3.MoveNext
Loop
txtSQL = "select distinct 学号 from cj where 学号 in(select 学号 from stud ) order by cj.学号"
Set mrc1 = ExecuteSQL(txtSQL)
If mrc1.EOF = True Then
Exit Sub
Else
End If
sum = 0
For i = 1 To mrc1.RecordCount
If Combo1(3).Text = "" Then
sss = MsgBox("学期不能为空!", vbExclamation + vbOKOnly, "警告")
Combo1(3).SetFocus
Exit Sub
Else
txtSQL = "select cj.学号,stud.姓名,cj.课程名称,cj.成绩,cj.绩点 from cj inner join stud on cj.学号=stud.学号 where cj.课程名称 in(select 课程名称 from zpcourse where 学期='" & Trim(Combo1(3).Text) & "') and cj.学号='" & Trim(mrc1.Fields(0)) & "'and cj.学期='" & Trim(Combo1(3).Text) & "' "
End If
Set mrc2 = ExecuteSQL(txtSQL)
If mrc2.EOF = True Then
Exit Sub
End If
If i = 1 Then
MSF1.Cols = mrc2.RecordCount + 15
MSF1.TextMatrix(0, 0) = "学号"
MSF1.TextMatrix(0, 1) = "姓名"
g = 2
For j = 1 To mrc2.RecordCount
MSF1.TextMatrix(0, g) = mrc2.Fields("课程名称")
g = g + 1
mrc2.MoveNext
Next j
MSF1.TextMatrix(0, g) = "综合测评"
For r = 1 To mrc2.RecordCount + 14
MSF1.ColAlignment(r) = 0
Next r
mrc2.MoveFirst
MSF1.Rows = 30
MSF1.Row = 1
End If
MSF1.Rows = MSF1.Rows + 1
MSF1.TextMatrix(MSF1.Row, 0) = mrc2.Fields(0)
MSF1.TextMatrix(MSF1.Row, 1) = mrc2.Fields(1)
g = 2
sum = 0
For j = 1 To mrc2.RecordCount
MSF1.Col = g
If Val(mrc2.Fields("成绩")) < 60 Then
MSF1.CellBackColor = vbRed
End If
MSF1.TextMatrix(MSF1.Row, g) = mrc2.Fields("成绩")
sum = sum + mrc2.Fields("绩点")
g = g + 1
mrc2.MoveNext
Next j
txtSQL = "select 成绩 from pshicj where 学期='" & Trim(Combo1(3).Text) & "'and 学号='" & MSF1.TextMatrix(MSF1.Row, 0) & "'"
Set mrc4 = ExecuteSQL(txtSQL)
If mrc4.EOF = True Then
Exit Sub
Else
End If
Do While Not mrc4.EOF
Dim avg1 As Single
avg1 = sum * 0.85 / total + mrc4.Fields(0)
MSF1.Col = g + 1
MSF1.TextMatrix(MSF1.Row, g) = avg1
MSF1.Row = MSF1.Row + 1
mrc1.MoveNext
mrc4.MoveNext
Loop
Next i
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmMain.Enabled = True
End Sub
Private Sub MSFlexGrid1_Click()
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 1
GridSort MSF1, MSF1.Col, 1
Case 2
GridSort MSF1, MSF1.Col, 2
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -