Set cmdObj = Server.CreateObject("ADODB.Command")
Set rsObj = Server.CreateObject("ADODB.RecordSet")
cmdObj.CommandText = "SELECT top 1 * FROM st_info ORDER by ID desc"
cmdObj.CommandType = 1
Set cmdObj.ActiveConnection = conn
rsObj.Open cmdObj, , 2,3
rsObj("user_number") = Request.Form("user_number")
rsObj("user_name") = Request.Form("user_name")
rsObj("user_zkzh") = Request.Form("user_zkzh")
rsObj("user_sfzh") = Request.Form("user_sfzh")
rsObj("user_sex") = Request.Form("user_sex")
rsObj("user_time") = Request.Form("user_time")
rsObj("user_address") = Request.Form("user_address")
rsObj("user_tel") = Request.Form("user_tel")
rsObj("user_major") = Request.Form("user_major")
rsObj("user_class") = Request.Form("user_class")
rsObj("user_gkcj") = Request.Form("user_gkcj")
rsObj.Update
rsObj.Close
set rsObj = nothing
set cmdObj = nothing
' CloseConn()
%>
<script language = java script>
<!--
alert("修改成功!");
window.location = "xxgl.asp"
-->
</script>
到这里,学生的信息管理模块的基本功能已经实现了。
成绩管理
成绩管理是本系统中最复杂的一个,也是最具有代表性的,他主要实现以下几个功能
成绩列表:由文件cjgl.asp.updatacj.asp和delcj.asp完成
添加成绩:它指向学生信息列表,因为每个学生对应一份成绩单
单科成绩排名:由dkcjcx.asp和dkcjcx.asp
总成绩排名:由zcjcx.asp和zcjpm.asp
⑴成绩列表
成绩列表中,管理员可以对成绩列表进行修改和删除操作,页尾的代码部分主要是为了实现记录的分页功能 。其实现代码如下:
成绩列表实现代码 cjgl.asp
<!--#include file="data.asp"-->
<!--#include file="user.asp"-->
<%
set rsobj=server.createobject("adodb.recordset")
sql="select * from cj order by id desc"
rsobj.open sql,conn,1,1
%>
<html>
<%
dim user_class,subject,testno
user_class=trim(request("user_class"))
subject=trim(request("subject"))
testno=trim(request("testno"))
%>
<%
set rs=server.createobject("adodb.recordset")
if user_class="all" then
sql="select * from cj where subject='"&subject&"' and testno='"&testno&"' order by cj desc"
else
sql="select * from cj where user_class='"&user_class&"' and subject='"&subject&"' and testno='"&testno&"' order by cj desc"
end if
rs.open sql,conn,1,1
%>
<html>
</center>
</div>
<div align="center">
<table border="1" width="600" cellspacing="0" cellpadding="4" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr>
<td width="388" colspan="6" align="center">
<p align="left">查询结果</p>
</td>
</tr>
<center>
<%
if Not(rs.bof and rs.eof) then'判别数据表中是否为空记录
NumRecord=rs.recordcount
rs.pagesize=10
NumPage=rs.Pagecount
if request("page")=empty then
NoncePage=1
else
if Cint(request("page"))<1 then
NoncePage=1
else
NoncePage=request("page")
end if
if Cint(Trim(request("page")))>Cint(NumPage) then NoncePage=NumPage
end if
else
NumRecord=0
NumPage=0
NoncePage=0
end if
%>
<tr>
<td width="107" align="center">准考证号</td>
<td width="108" align="center">姓名</td>
<td width="108" align="center">班级</td>
<td width="108" align="center">考次</td>
<td width="108" align="center">科目</td>
<td width="46" align="center">成绩</td>
</tr>
<%if Not(rs.bof and rs.eof) then
rs.move (Cint(NoncePage)-1)*10,1
for i=1 to rs.pagesize
%>
<tr>