txtZf(80 + i).Text = RSCount!rs
RSCount.Close
End If
Next i
End If
If Combo3.Text = "是" Then
For i = 0 To 9
If txtZf(i).Text <> 0 Then
RSCount.Open "select count(*) as ywj from 成绩表 AS a INNER JOIN 学籍表 AS b ON a.考试号 = b.考试号 where b.班级 like " & Combo1.Text & " and a.考试性质 = '" & Combo2.Text & "' and a." & labXk(i).Caption & " >= " & txtZf(i).Text * 0.6, Con, adOpenStatic, , adCmdText
txtZf(10 + i).Text = RSCount!ywj
txtZf(20 + i).Text = RSCount!ywj / Text1.Text * 100
RSCount.Close
RSCount.Open "select count(*) as ywy from 成绩表 AS a INNER JOIN 学籍表 AS b ON a.考试号 = b.考试号 where b.班级 like " & Combo1.Text & " and a.考试性质 = '" & Combo2.Text & "' and a." & labXk(i).Caption & ">=" & txtZf(i).Text * 0.85, Con, adOpenStatic, , adCmdText
txtZf(30 + i).Text = RSCount!ywy
txtZf(40 + i).Text = RSCount!ywy / Text1.Text * 100
RSCount.Close
RSCount.Open "select sum(" & labXk(i).Caption & ") as ywz , count(*) as rs from 成绩表 AS a INNER JOIN 学籍表 AS b ON a.考试号 = b.考试号 where b.班级 like " & Combo1.Text & " and a.考试性质 = '" & Combo2.Text & "'", Con, adOpenStatic, , adCmdText
txtZf(50 + i).Text = RSCount!ywz
txtZf(60 + i).Text = RSCount!ywz / Text1.Text
txtZf(70 + i).Text = txtZf(20 + i).Text * 0.4 + txtZf(40 + i).Text * 0.2 + txtZf(60 + i).Text * 0.4
txtZf(80 + i).Text = RSCount!rs
RSCount.Close
End If
Next i
End If
Command3.Enabled = True
Exit Sub
wrong:
If err.Number = 3705 Then
RSCount.Close
MsgBox "内部错误,请重新按一下“统计”按钮!"
Exit Sub
End If
MsgBox err.Number & err.Description & ",请检查您的初始值"
Call ExecErr(Date, Me.Caption, err.Number, err.Source, err.Description)
Dim ctl As Control
For Each ctl In Controls
If TypeOf ctl Is TextBox Then
ctl.Text = "0"
End If
Next ctl
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
On Error GoTo err
Set CmdExec = New ADODB.Command
CmdExec.ActiveConnection = Con
Dim SqlString As String
For i = 0 To 9
If txtZf(i).Text <> 0 Then
SqlString = "insert into 考核表(班级,在籍数,计外,考试性质,学科,卷面总分,及格数,及格率,优秀数,优秀率,总分,均分,[442],参考数) values " & "(" & Combo1.Text & "," & Text1.Text & ",'" & Combo3.Text & "','" & Combo2.Text & "','" & labXk(i).Caption & "'," & txtZf(i).Text & "," & txtZf(i + 10).Text & "," & txtZf(i + 20).Text & "," & txtZf(i + 30).Text & "," & txtZf(i + 40).Text & "," & txtZf(i + 50).Text & "," & txtZf(i + 60).Text & ",'" & txtZf(i + 70).Text & "'," & txtZf(i + 80).Text & ")"
CmdExec.CommandText = SqlString
首页 上一页 7 8 9 10 11 12 13 下一页 尾页 10/14/14
电子教务管理系统vb(十)由毕业论文网(www.huoyuandh.com)会员上传。