编程就像生活一样!总是需要一些经验,别人的建议亦不可缺少!!
<!--#include file="conn.asp"--><!--#include file="check.asp"-->
<script Language="vbscript">
sub check()
c=document.form1.page.value
if c<>"" then
if not IsNumeric(c) then
msgbox " 页数只能输入数字"
document.form1.page.select()
exit sub
else
end if
else
msgbox"请输入想要转到页数"
document.form1.page.select()
exit sub
end if
document.form1.submit()
end sub
</script>
<%flag1=0
flag2=0
reportid=trim(request("reportid"))
set rs=Server.CreateObject("ADODB.Recordset")
sqls="select * from examination "
set rss=conn.execute(sqls)
if rss.eof then
titles="暂无成绩信息"
flag1=1
else
if reportid="" then
reportid=rss("examinationid")
flag2=1
else
reportid=reportid
end if
set rs1=conn.execute("select * from examination where examinationid="&reportid&"")
title="第 "&rs1("examinationid")&" 期考试统计"
if flag2=1 then title=title&"<font color=red>(最新一期)</font>"
set rs2=conn.execute("select * from test where examinationid="&rs1("examinationid")&"")
titles=title&"<p>(判断题数"&rs2("rightorwrongid")&"题/"&rs2("rightorwrongscore")&"分,选择题数"&rs2("selectid")&"题/"&rs2("selectscore")&"分,填空题数"&rs2("fillingid")&"题/"&rs2("fillingscore")&"分)</p>"
zf=rs2("rightorwrongid")*rs2("rightorwrongscore")+rs2("selectid")*rs2("selectscore")+rs2("fillingid")*rs2("fillingscore")
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网上考试系统</title>
<link rel="stylesheet" type="text/css" href="../css.css">
</head>
<body topmargin="0" leftmargin="0">
<p>
<p align="center"><font face="隶书" size="6" >成绩统计管理</font></p>
<div align="center">
<center>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="500">
<tr>
<td align="center" colspan="4"> 往期统计:
<select name="cate" size="1" style="background-color: #EFEFF7" onchange="javascript:self.location=this.options[this.selectedIndex].value">
<%set rs3=conn.execute("select distinct examinationid from examination order by examinationid desc")
while not rs3.eof %>
<option value="report.asp?reportid=<%=rs3("examinationid")%>" <%if cint(request("examinationid"))=cint(rs3("examinationid")) then response.write "selected"%>>第<%=rs3("examinationid")%>期</option>
<%rs3.movenext
wend%>
</select> <%=titles%>
<form method="get" name=form2 action="">
<%keyword=trim(request("keyword"))
if keyword="" then
keywords="所有考生"
else
keywords=keyword
end if
%>
<p>以下为姓名为 <font color=red><%=keywords%></font> 的考生列表 输入考生姓名<input type="text" name="keyword" size="20" class="line"> <input type="submit" value="查找" name="B1" style="width: 60; height: 22; border-style: solid; border-width: 1px; background-color: #FFFFFF"></form></td>
</tr>
<tr>
<td align="center" bgcolor="#000099"><font color="#FFFFFF">考生姓名</font></td>
<td align="center" bgcolor="#000099"><font color="#FFFFFF">分数</font></td>
<td align="center" bgcolor="#000099"><font color="#FFFFFF">补考设置</font></td>
<td align="center" bgcolor="#000099"><font color="#FFFFFF">补考成绩</font></td>
</tr>
<%
if flag1=1 then
else
sql="select student.*,examination.* from student,examination where student.studentname like '%"&keyword&"%' and examination.studentnumber=student.studentnumber and examination.examinationid="&rs1("examinationid")&" order by student.studentnumber desc"
rs.open sql,conn,3,1,1
rs.pagesize=10
if not (rs.eof and rs.bof) then
Page = cint(Request.querystring("Page"))
If Page < 1 Then Page = 1
If Page > rs.PageCount Then Page = rs.PageCount
showpages rs,Page
%>
<%else%>
<tr><td colspan=4><center><font color=red>暂无此学员信息</font></center></td></tr>
<%end if%>
<%
Sub showpages( rs,Page )
rs.AbsolutePage = Page
for i=0 to rs.pagesize-1
j=j+1
if j mod 2 =0 then
bg="#EFEFF7"
else
bg="#ffffff"
end if
if rs("score")>=cint(zf*6/10) then
fen="<font colot=#008000>"&rs("score")&"分</font>"
bk="不需要"
bfen="不需要"
else
fen="<font colot=red>"&rs("score")&"分</font>"
bk="<a href=test_again.asp?studentnumber="&rs("studentnumber")&"&reportid="&reportid&">批准补考</a>"
bfen="需要补考"
if rs("pass")=True then
bk="已批准补考"
if rs("makeup")=0 then
bfen="还未补考"
else
if rs("makeup")>=cint(zf*6/10) then
bfen="<font colot=#008000>"&rs("makeup")&"分</font>"
else
bfen="<font colot=red>"&rs("makeup")&"分</font>"
end if
end if
end if
end if
%>
<tr bgcolor=<%=bg%>>
<td align="center"><a href="student.asp?id=<%=rs("studentnumber")%>"><%=rs("studentname")%></a></td>
<td align="center"> <%=fen%></td>
<td align="center">
<%=bk%></td>
<td align="center">
<%=bfen%></td>
</tr>
<%
rs.movenext
If rs.EOF Then Exit For
Next%>
<%End Sub
end if %>
<tr>
<td colspan="4" align="center">
<form action=report.asp?keyword=<%=keyword%>&reportid=<%=reportid%> method="get" name=form1 >
<%
response.write rs.pagesize&"条一页 "
if Page=1 then
response.write"第一页 "
end if
If Page <> 1 Then
Response.Write "<A HREF=report.asp?keyword="&keyword&"&reportid="&reportid&"&Page=1>第一页</A>?"
Response.Write "<A HREF=report.asp?keyword="&keyword&"&reportid="&reportid&"&Page=" & (Page-1) & ">上一页</A>?"
End If
If Page <> rs.PageCount Then
Response.Write "<A HREF=report.asp?keyword="&keyword&"&reportid="&reportid&"&Page=" & (Page+1) & ">下一页</A>?"
Response.Write "<A HREF=report.asp?keyword="&keyword&"&reportid="&reportid&"&Page=" & rs.PageCount & ">最后一页</A>?"
End If
if page= rs.PageCount then
response.write"最后一页 "
end if
response.write "总共有"&rs.pagecount&"页, 目前是第"&page&"页"
'response.write page&"/"&rs.pagecount&"页</center>"
%>
转到<font class="a">
<input maxLength="8" size="4" name="page" value=<%=page%>>
<input type="hidden" value=<%=keyword%> name="keyword">
<input type="hidden" value=<%=reportid%> name="reportid">
页<span lang="en-us"> </span>
<input class="buttonface" type="button" value=" Goto " onclick=check() style="width: 60; height: 22; border-style: solid; border-width: 1px; background-color: #FFFFFF"></font><br>
</a>
</form>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>
看起来有些麻烦!解决这个问题恐怕需要热心的您具备一些东西,比如有sql sever 2000数据库和iis的支持!
现在我来说明这个程序段的病症。就是在浏览执行的时候出现了这样的问题:
无法显示网页
试图访问的网页出现问题,无法显示。
请尝试执行下列操作:
单击刷新按钮,或稍后重试。
打开 localhost 主页,然后查找与所需信息相关的链接。
HTTP 错误 500.100 - 内部服务器错误 - ASP 错误
Internet 信息服务
技术信息(用于支持人员)
错误类型:
ADODB.Recordset (0x800A0E78)
对象关闭时,不允许操作。
/admin/report.asp, 第 183 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
请您务必帮我!!!
这个问题是不是是 “Internet 信息服务”安装的时候出错了!
谢谢您