之前问题在大家关怀下解决了,但现在有个新问题
<!--#include file="conn.asp"-->
<%
if session("user")="" then
response.write "您无此权限"
response.end
end if
%>
<%
T1 = trim(request("T1"))
T2 = trim(request("T2"))
T3 = trim(request("T3"))
T4=request.form("kecm")
if T1 = "" then
conn.close
set conn = nothing
response.write "<script>alert('请输入起始分数');history.go(-1);</script>"
response.end
end if
if T2 = "" then
conn.close
set conn = nothing
response.write "<script>alert('请输入结束分数');history.go(-1);</script>"
response.end
end if
if T3 = "" then
conn.close
set conn = nothing
response.write "<script>alert('请输入每班级人数');history.go(-1);</script>"
response.end
end if
if T1 > T2 then
response.write "<script>alert('起始分数要低于结束分数');history.go(-1);</script>"
response.end
end if
%>
<%dim cno
sqla = "select * from subject where 课题名称 ='"&T4&"'"
set aa = server.createobject("adodb.recordset")
aa.open sqla,conn,1,1
cno=aa("选题编号")
response.write cno
sql = "select * from student where xtbh = '"&cno&"'and student.cj between'"&T1&"' and '"&T2&"' order by 专业"
set rst = server.createobject("adodb.recordset")
rst.open sql,conn,1,1
%>
<html>
<head>
<title>分班结果</title>
<link rel="stylesheet" href="style.css">
</head>
<body topmargin="0">
<!--#include file="top.asp"-->
<%
if Not(rst.bof and rst.eof) then'判别数据表中是否为空记录
NumRecord=rst.recordcount
rst.pagesize=T3
NumPage=rst.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
%>
<div align="center">
<table width="760" height="35" cellspacing="0" cellpadding="0">
<td background="images/top_1.jpg">
<p align="center"> <b><font size="3">此为本课程</font><font size="5" color="#FF0000"><%=NoncePage%></font><font size="3">班学生名单</font></table>
</div>
<div align="center">
<center>
<table border="0" width="700" cellspacing="0" cellpadding="0">
<table border="1" width="760" bordercolorlight="#000000" cellspacing="1" cellpadding="5" bordercolordark="#FFFFFF" height="33">
<tr>
<td width="56" bgcolor="#EBE9FE" align="center" height="11">学号</td>
<td width="116" bgcolor="#EBE9FE" align="center" height="11">姓名</td>
<td width="118" bgcolor="#EBE9FE" align="center" height="11">专业</td>
<td width="249" bgcolor="#EBE9FE" align="center" height="11">所选课程</td>
<td width="77" bgcolor="#EBE9FE" align="center" height="11">联系方式</td>
<td width="76" bgcolor="#EBE9FE" align="center" height="11">成绩</td>
</tr>
<%if Not(rst.bof and rst.eof) then
rst.move (Cint(NoncePage)-1)*T3,1
for i=1 to rst.pagesize
%>
<tr>
<td width="56" align="center" height="1"><%=rst("学号")%></td>
<td width="116" align="center" height="1"><%=rst("姓名")%></td>
<td width="118" align="center" height="1"><%=rst("专业")%></a></td>
<td width="249" align="center" height="1"><%=T4%></td>
<td width="77" align="center" height="1"><%=rst("电话")%></a></td>
<td width="76" align="center" height="1"><%=rst("cj")%></td>
</tr>
<% rst.movenext
if rst.eof then exit for
next
else
response.write "<tr><td colspan=13><marquee scrolldelay=120 behavior=alternate>没有找到任何记录!!!</marquee></td></tr>"
end if
rst.close
set rst=nothing
%>
</table>
</table>
</div>
<div align="center">
<table width="760" border="0">
<tr>
<td height="17">
<div align="right">
<input type="hidden" name="page" value="<%=NoncePage%>">
<%
if NoncePage>1 then
response.write "|<a href=fenban1.asp?page=1&T1="&T1&"&T2="&T2&"&T3="&T3&"&T4="&T4&"'>首 页</a>| |<a href=fenban1.asp?page="&NoncePage-1&">上一页</a>| "
else
response.write "|首 页| |上一页| "
end if
if Cint(Trim(NoncePage))<Cint(Trim(NumPage)) then
response.write "|<a href=fenban1.asp?page="&NoncePage+1&">下一页</a>| |<a href=fenban1.asp?page="&NumPage&">尾 页</a>|"
else
response.write "|下一页| |尾 页|"
end if
%>
页次:<font color="#0033CC"><%=NoncePage%></font>/<font color="#0033CC"><%=NumPage%></font>
共<font color="#0033CC"><%=NumRecord%></font>条记录 </div>
</td>
</table>
<%
aa.close
set aa=nothing
%>
</div>
</center>
<!--#include file="down.asp"-->
</body>
</html>
假如查询出来的人数多于设定的每班人数T3,就要分页,但在点下一页时,发现参数传不到下页去,有人说把response.write "|<a href=fenban1.asp?page=1>首 页</a>
改为:
response.write "|<a href='fenban1.asp?page=1&t1="&t1&"&t2="&t2&"&t3="&t3&"&t4="&t4&"'>首 页</a>
就能传过去,可我试验了一下,好像传过去了,但提示aa.open sqla,conn,1,1(打红色部分)BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。怎么解决呢?
[此贴子已经被作者于2007-5-7 22:06:39编辑过]