| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1304 人关注过本帖
标题:[求助]学生成绩管理
只看楼主 加入收藏
ltd520541
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-5-21
收藏
 问题点数:0 回复次数:10 
[求助]学生成绩管理
学生成绩管理
要求:可以新建或打开一个班级的成绩,各班所开设的课程和学生名册可以任意设定,成绩可以随时录入、修改和保存,数据以文件形式保存,可以计算每个学生的总分、均分和全班各门课程的平均分(用VB6编写)


非常感谢。。。。。。
搜索更多相关主题的帖子: 学生成绩 课程 管理 名册 
2007-05-21 11:24
ouzhiguang
Rank: 1
来 自:湖南长沙
等 级:新手上路
威 望:1
帖 子:240
专家分:0
注 册:2007-5-18
收藏
得分:0 

各班开设的课程和学生名册固定了没????

2007-05-21 12:47
ltd520541
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-5-21
收藏
得分:0 
回复:(ouzhiguang)各班开设的课程和学生名册固定了...

全部都还没有固定好的

2007-05-21 13:20
细细的雨点
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-5-21
收藏
得分:0 
应该可以的!!做一个输入窗体把输入的数据保存到数据库~~然后再把数据调出来哦~~我说一个思路~!!最近我也做个类似的输入输出
2007-05-21 13:45
a59936758
Rank: 1
等 级:新手上路
帖 子:85
专家分:0
注 册:2007-4-13
收藏
得分:0 
我怎么看象是毕业设计啊

咋学学不会.还就偏要学
2007-05-21 14:15
ouzhiguang
Rank: 1
来 自:湖南长沙
等 级:新手上路
威 望:1
帖 子:240
专家分:0
注 册:2007-5-18
收藏
得分:0 

要是固定了学生姓名和课程就很好弄,只要做一个成绩录入 修改与统计的工作,等等,程序就快出来了!

2007-05-21 14:21
ouzhiguang
Rank: 1
来 自:湖南长沙
等 级:新手上路
威 望:1
帖 子:240
专家分:0
注 册:2007-5-18
收藏
得分:0 

花了一下午 终于弄出来!你给我你的邮箱,我把工程打包发给你,我做得和乱,你还要该该!你上面的要求是实现了
Private Sub Form_Load() '初始化开的课程,在这里所有的班级都开设了这九门课程!
Combo1.AddItem "数学"
Combo1.AddItem "语文"
Combo1.AddItem "英语"
Combo1.AddItem "生物"
Combo1.AddItem "化学"
Combo1.AddItem "物理"
Combo1.AddItem "政治"
Combo1.AddItem "历史"
Combo1.AddItem "地理"
End Sub
'这里是datalist控件 与 adodc1绑定,在列表框中显示 学生姓名
Private Sub DataList1_Click()
Text1.Text = DataList1.BoundText' 用与显示学生所在班级
Text4.Text = DataList1.Text '这个是测试用的,可以删去,不过下面有关代码就要换一下!
End Sub
'在这里执行的是修改
Private Sub command4_Click()
Dim a As Single
Dim b As Integer
Dim c As String

if combo1.text="" then exit sub
Adodc1.Refresh
Adodc1.Recordset.Find ("studentname like '" & Text4.Text & "' ") '查找学生信息
If Adodc1.Recordset.EOF Or Adodc1.Recordset.BOF Then'查找失败
MsgBox "123"
Else
'要找的学生对应科目的成绩
If Combo1.Text = "数学" Then
Adodc1.Recordset("数学成绩") = Text3.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "语文" Then
Adodc1.Recordset("语文成绩") = Text3.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "英语" Then
Adodc1.Recordset("英语成绩") = Text3.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "生物" Then
Adodc1.Recordset("生物成绩") = Text3.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "化学" Then
Adodc1.Recordset("化学成绩") = Text3.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "物理" Then
Adodc1.Recordset("物理成绩") = Text3.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "政治" Then
Adodc1.Recordset("政治成绩") = Text3.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "历史" Then
Adodc1.Recordset("历史成绩") = Text3.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "地理" Then
Adodc1.Recordset("地理成绩") = Text3.Text
Adodc1.Recordset.Update
End If
Adodc1.Recordset("学生总分") = Val(Adodc1.Recordset("数学成绩")) + Val(Adodc1.Recordset("语文成绩")) + Val(Adodc1.Recordset("英语成绩")) + Val(Adodc1.Recordset("化学成绩")) + Val(Adodc1.Recordset("生物成绩")) + Val(Adodc1.Recordset("物理成绩")) + Val(Adodc1.Recordset("政治成绩")) + Val(Adodc1.Recordset("历史成绩")) + Val(Adodc1.Recordset("地理成绩"))
'控制保存结果,保留两位小数
a = CSng(Val(Adodc1.Recordset("学生总分")) / 9)
b = InStr(Trim(Str(a)), ".")
If b <> 0 Then
If Val(Mid(Str(a), b + 3, 1)) >= 5 Then'若小数点后三位不小于5 则+0.01
c = Str(Val(Mid(Trim(Str(a)), 1, b + 2)) + 0.01)
Else
c = Str(Val(Mid(Trim(Str(a)), 1, b + 2)))
End If
Adodc1.Recordset("学生平均分") = Trim(c)

Else
Adodc1.Recordset("学生平均分") = Trim(Str(a) & ".00")
End If
Adodc1.Recordset.Update
MsgBox "修改完毕!"
End Sub

'这部分是提供查询学生成绩的,不过只能查对应课程的成绩
Private Sub Command2_Click()
If Combo1.Text = "" Then

MsgBox "请选课程名!"
Exit Sub
End If
Adodc1.Refresh
Adodc1.Recordset.Find ("studentname like '" & Text4.Text & "' ")
If Adodc1.Recordset.EOF Or Adodc1.Recordset.BOF Then
MsgBox "123"
Else
If Combo1.Text = "数学" Then
Text3.Text = Adodc1.Recordset("数学成绩")

End If
If Combo1.Text = "语文" Then
Text3.Text = Adodc1.Recordset("语文成绩")

End If
If Combo1.Text = "英语" Then
Text3.Text = Adodc1.Recordset("英语成绩")

End If
If Combo1.Text = "生物" Then
Text3.Text = Adodc1.Recordset("生物成绩")

End If
If Combo1.Text = "化学" Then
Text3.Text = Adodc1.Recordset("化学成绩")

End If
If Combo1.Text = "物理" Then
Text3.Text = Adodc1.Recordset("物理成绩")

End If
If Combo1.Text = "政治" Then
Text3.Text = Adodc1.Recordset("政治成绩")

End If
If Combo1.Text = "历史" Then
Text3.Text = Adodc1.Recordset("历史成绩")

End If
If Combo1.Text = "地理" Then
Text3.Text = Adodc1.Recordset("地理成绩")

End If

End If

End Sub
,这是提供录入的部分,其实跟修改没什么两样,仔细看看有什么不同吧!

Private Sub Command1_Click()
Dim a As Single
Dim b As Integer
Dim c As String
If Combo1.Text = "" Then
MsgBox "请选课程名!"
Exit Sub

End If
Adodc1.Refresh
Adodc1.Recordset.Find ("studentname like '" & Text4.Text & "' ")
If Adodc1.Recordset.EOF Or Adodc1.Recordset.BOF Then
MsgBox "123"
Else
If Combo1.Text = "数学" Then
Adodc1.Recordset("数学成绩") = Text2.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "语文" Then
Adodc1.Recordset("语文成绩") = Text2.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "英语" Then
Adodc1.Recordset("英语成绩") = Text2.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "生物" Then
Adodc1.Recordset("生物成绩") = Text2.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "化学" Then
Adodc1.Recordset("化学成绩") = Text2.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "物理" Then
Adodc1.Recordset("物理成绩") = Text2.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "政治" Then
Adodc1.Recordset("政治成绩") = Text2.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "历史" Then
Adodc1.Recordset("历史成绩") = Text2.Text
Adodc1.Recordset.Update
End If
If Combo1.Text = "地理" Then
Adodc1.Recordset("地理成绩") = Text2.Text
Adodc1.Recordset.Update
End If

Adodc1.Recordset("学生总分") = Val(Adodc1.Recordset("数学成绩")) + Val(Adodc1.Recordset("语文成绩")) + Val(Adodc1.Recordset("英语成绩")) + Val(Adodc1.Recordset("化学成绩")) + Val(Adodc1.Recordset("生物成绩")) + Val(Adodc1.Recordset("物理成绩")) + Val(Adodc1.Recordset("政治成绩")) + Val(Adodc1.Recordset("历史成绩")) + Val(Adodc1.Recordset("地理成绩"))
a = CSng(Val(Adodc1.Recordset("学生总分")) / 9)
b = InStr(Trim(Str(a)), ".")
If b <> 0 Then
If Val(Mid(Str(a), b + 3, 1)) >= 5 Then
c = Str(Val(Mid(Trim(Str(a)), 1, b + 2)) + 0.01)
Else
c = Str(Val(Mid(Trim(Str(a)), 1, b + 2)))
End If
Adodc1.Recordset("学生平均分") = Trim(c)

Else
Adodc1.Recordset("学生平均分") = Trim(Str(a) & ".00")
End If
Adodc1.Recordset.Update
MsgBox "录入完毕!"

End If
End Sub
'这部分执行全班同学各科的平均分
Private Sub Command3_Click()
Dim i As Integer
Dim a(1 To 9) As Single
Dim b(1 To 9) As String
Adodc1.Refresh
Adodc1.Recordset.Find (" class like '" & Text1.Text & "' ")找班级相同的人,

If Adodc1.Recordset.EOF Or Adodc1.Recordset.BOF Then
MsgBox "123"
Else
For i = 1 To 9
a(i) = Val(DataGrid1.Columns(DataGrid1.Col + i + 1))
Next i
j = 1
s1:

Adodc1.Recordset.MoveNext '看还有没有相同的
Adodc1.Recordset.Find (" class like '" & Text1.Text & "' ")'找班级相同的人,
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveLast
For i = 1 To 9
a(i) = a(i) / j'控制输入结果为 保留两位小数!
d = InStr(Trim(Str(a(i))), ".")
If d <> 0 Then
If Val(Mid(Str(a(i)), d + 3, 1)) >= 5 Then
b(i) = Str(Val(Mid(Trim(Str(a(i))), 1, d + 2)) + 0.01)
Else
b(i) = Str(Val(Mid(Trim(Str(a(i))), 1, d + 2)))
End If
Else
b(i) = Str(a(i)) & ".00"
End If
Next i
Adodc2.Recordset("数学平均成绩") = b(1)
Adodc2.Recordset("语文平均成绩") = b(2)
Adodc2.Recordset("英语平均成绩") = b(3)
Adodc2.Recordset("化学平均成绩") = b(4)
Adodc2.Recordset("生物平均成绩") = b(5)
Adodc2.Recordset("物理平均成绩") = b(6)
Adodc2.Recordset("政治平均成绩") = b(7)
Adodc2.Recordset("历史平均成绩") = b(8)
Adodc2.Recordset("地理平均成绩") = b(9)
Adodc2.Recordset.Update
Exit Sub
Else
For i = 1 To 9
a(i) = a(i) + Val(DataGrid1.Columns(DataGrid1.Col + i + 1))
Next i
j = j + 1
GoTo s1
End If
End If

End Sub
最后本工程设置了2个adodc控件 其visible属性为false 2个datagrid 控件 几个标签,几个命令按钮,几个text
数据库建了两张表,一个张的字段分别是 班级,学生姓名,数学成绩........地理成绩,学生总分,学生平均分.表二 班级,数学平均成绩....地理平均成绩
adodc1关联表一adodc2关联表二
上面的程序 刚刚做完,还没完善,也么经过多少的测试,还有一导出的功能 我还没写,那功能也容易实现!你先看看吧!

2007-05-21 18:51
ltd520541
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-5-21
收藏
得分:0 
回复:(ouzhiguang)花了一下午 终于弄出来!你给我你...

真的非常非常感谢你啊。。。。。因为这个学期的VB课程提前考试啊。。。。。。。
我的邮箱 ltd52541@yahoo.com.cn

我的QQ 275802672

以后可能还要向你好好请教啊。。。。

2007-05-21 21:07
ouzhiguang
Rank: 1
来 自:湖南长沙
等 级:新手上路
威 望:1
帖 子:240
专家分:0
注 册:2007-5-18
收藏
得分:0 
你要该一下,数据表的连接路径
2007-05-21 22:16
ltd520541
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-5-21
收藏
得分:0 
回复:(ouzhiguang)你要该一下,数据表的连接路径
哦。。。。
正在认真读程序。。。。
那个贪吃蛇的程序你以前有做过吗???
如果有做好的在的话麻烦你可以发到我的邮箱里吗??谢谢。。。。
2007-05-21 23:11
快速回复:[求助]学生成绩管理
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013858 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved