asp 分页显示数据问题
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!--#include file="Check_Sql123.asp" -->
<!--#include file="admin_qx.asp" -->
<% call islogin() %>
<!--#include file="jm5.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="conn_db123.asp" -->
<%
admin_id_log=session("admin_id_log")
admin_shenfen=session("admin_shenfen")
if admin_id_log="" then
response.Write "<script language=javascript>{window.alert('您尚未登录或登录超时,请重新登录!');window.open('login.asp','_parent'); }</script>"
response.end
end if
if admin_shenfen<>"0" then
response.Write "<script language=javascript>{window.alert('您没有权限,请重新登录!');window.open('login.asp','_parent'); }</script>"
response.end
end if
%>
<SCRIPT language=javascript>
function unselectall()
{
if(document.myform.chkAll.checked){
document.myform.chkAll.checked = document.myform.chkAll.checked&0;
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll"&&e.disabled==false)
e.checked = form.chkAll.checked;
}
}
function ConfirmDel()
{
if(document.myform.Naction.value=="biDel")
{
document.myform.action="man_munber.asp?action=biDel";
if(confirm("此操作不能恢恢复,确定要删除选中的记录吗?"))
return true;
else
return false;
}
else
{
document.myform.action="Admin_ArticleMove.asp";
if(document.myform.TargetClassID.value=="")
{
alert("不能将文章移动到含有子栏目的栏目或外部栏目中!");
return false;
}
if(confirm("确定要将选中的文章移动到指定的栏目吗?"))
return true;
else
return false;
}
}
</SCRIPT>
<%
session("url")="s_ck0.asp?pageno="&pageno
sub del()
action=request("action")
id=saferequest("id")
if action="biDel" then
dim k,rsdel
set rsdel=server.createobject("adodb.recordset")
for each k in request.form("id")
sqldel="select * from student where sno="&k
rsdel.open sqldel,conn,1,3
rsdel.delete
rsdel.update
rsdel.close
next
elseif action="del" then
set rs=server.createobject("adodb.recordset")
sql="select * from student where sno="&id
rs.open sql,conn,1,3
rs.delete
rs.update
rs.close
end if
response.redirect session("url")
end sub
%>
<%
if request("action")="del" then
call del()
elseif request("action")="biDel" then
call del()
else
call managemunber()
end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<title>学生信息管理</title>
<style type="text/css">
<!--
.STYLE5 {color: #000000}
.STYLE15 {font-size: 14; color: #FF0000; }
.STYLE7 {font-size: 12px; color: #0000FF; }
.STYLE17 {color: #006600}
.STYLE4 {font-size: 12px; color: #FF0000; }
.style1 {color: #0000FF}
body {
SCROLLBAR-FACE-COLOR: #c6ebde;
SCROLLBAR-HIGHLIGHT-COLOR: #ffffff;
SCROLLBAR-SHADOW-COLOR: #39867b;
SCROLLBAR-3DLIGHT-COLOR: #39867b;
SCROLLBAR-ARROW-COLOR: #330000;
SCROLLBAR-TRACK-COLOR: #e2f3f1;
SCROLLBAR-DARKSHADOW-COLOR: #ffffff;
background-image: url();
background-color: #d6dff7;
}
body,td,th {
font-size: 13px;
}
.STYLE13 {color: #0000FF; font-size: 14px; }
.STYLE2 {color: #FF0000}
.style3 {color: #FF0000}
-->
</style>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<%sub managemunber()
%>
<table class=tableBorder width="95%" border=0 align="center" cellpadding=5 cellspacing=1>
<tbody>
<tr>
<th width="100%" height=21 sytle="line-height:150%"><span class="STYLE7">【学生信息管理】</span></th>
</tr>
<tr>
<td class=forumRow>
<div align="center"><form name="myform" method="Post" action="" onSubmit="return ConfirmDel();">
<table width="99%" border="1" align="center" cellpadding="3" cellspacing="1" bordercolor="#F3F3F3" style="border-collapse: collapse">
<tr>
<td width="3%" height="30" align="center" class="STYLE7">选中</td>
<td width="10%" height="30" align="center" class="STYLE7">姓名</td>
<td width="5%" class="STYLE5" align="center">性别</td>
<td width="20%" class="STYLE7" align="center">身份证号</td>
<td width="25%" class="STYLE5" align="center">班级</td>
<td width="16%" class="STYLE7" align="center">宿舍</td>
<td width="7%" class="STYLE5" align="center">籍贯</td>
<td width="17%" align="center" class="STYLE7">操 作</td>
</tr>
<%
sql="select * from student order by zctime desc"
url="s_ck0.asp?pageno="
rs.CursorLocation=3
rs.open sql,conn,1,1
if rs.eof then
%>
<tr>
<td height="60" colspan="7" align="left" class="STYLE7"> 暂无学生信息!</td>
</tr>
<%
else
totalcount=rs.recordcount
pagesize=20
rs.pagesize=pagesize
pagecount=rs.pagecount
PageNo=saferequest("PageNo")
intpageno pageno,pagecount
rs.AbsolutePage=pageno
for j=1 to rs.PageSize
bid=rs("bid")
sgno=rs("sgno")
sql="SELECT b_name FROM class where bid='" &rs("bid")& "'"
rs2.open sql,cn,1,2
response.Write(sql)
if not rs2.eof then
b_name=rs2("b_name")
else
b_name="暂未分班!"
end if
rs2.close
set rs2=nothing
sql="SELECT sgname,sglb FROM sg where sgno='" &rs("sgno")& "'"
ask.open sql,cn,1,2
if not ask.eof then
sgname=ask("sgname")
sglb=ask("sglb")
else
sgname="暂未分宿舍!"
sglb=""
end if
ask.close
set ask=nothing
%>
<tr>
<td width="3%" height="30" align="center" class="STYLE7"><input name='id' type='checkbox' onClick="unselectall()" id="id" value='<%=rs("sno")%>'></td>
<td width="10%" height="30" align="center" class="STYLE7"><%=rs("s_name")%></td>
<td width="5%" class="STYLE5" align="center"><%if rs("s_xb")=1 then%>女<%else%>男<%end if%></td>
<td width="20%" class="STYLE7" align="center"><%=rs("sfzno")%></td>
<td width="25%" class="STYLE5" align="center"><%=b_name%></td>
<td width="16%" class="STYLE7" align="center"><%=sglb%> <%=sgname%><%response.Write(rs("sgno"))%></td>
<td width="7%" class="STYLE5" align="center"><%=rs("sf")%></td>
<td width="17%" align="center" class="STYLE7"><a href="s_ck.asp?id=<%=rs("sno")%>" class="STYLE7">查 看</a>/<a href="s_xg.asp?id=<%=rs("sno")%>" class="STYLE7">修 改</a>/<a href="javascript:if (confirm('确定要删除此条信息吗?')){location='s_ck0.asp?action=del&id=<%=rs("sno")%>';}" class="STYLE7">删 除</a></td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
%><tr>
<td height="60" colspan="8" align="left" class="STYLE7"> <input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
全选
<input name="submit" type='submit' value='删除' onClick="document.myform.Naction.value='biDel'"> </td></tr>
<tr >
<td height="60" colspan="8" align="right" ><span class="STYLE7">
<%
if totalcount>pagesize then Showpage pagecount,totalcount,PageNo,url,pagesize,1
%>
</span></td>
</tr>
<%
end if
rs.close
set rs=nothing
%>
</table></form>
</div>
</td>
</tr>
</tbody>
</table>
<%end sub
%>
</body>
</html>
代码如上,现象是:PageSize=1 这么分页显示数据就正确,如PageSize>1则分页显示时宿舍和班级的数据显示不正确
请高手指教下