关于查询结果分页!
高手帮忙看下:我想对查询结果进行分页,为什么只显示到第二页,在第二页就不显示下一页了?<% PageSize=trim(request("pageSize"))
if PageSize<>".then
session("pageSize")=PageSize
pz=PageSize
end if
if PageSize=""then
if session("pageSize")<>""then
pz=session("pageSize")
else
pz=3
end if
end if
rs.PageSize=pz
pagecount=rs.PageCount
page=int(request.QueryString ("page"))
if page<=0 then page=1
if request.QueryString("page")="" then page=1
rs.AbsolutePage=page
%>
<p align="center"><span class="style4"> <%=DATE%>共<%=rs.recordcount%>条记录</span> 合计:
<%=total%>kg</p>
<TABLE width=57% border=1 align="center" cellPadding=0 cellSpacing=0
borderColorLight=#6699ff borderColorDark=#ffffff bgcolor="#FFFFFF" style="border-collapse:collapse">
<tr>
<td width="90" nowrap="nowrap" bgcolor="#FFCC66"><div align="center">序号</div></td>
<td width="113" align="center" nowrap="nowrap" bgcolor="#FFCC66">乡镇</td>
<td width="101" nowrap="nowrap" bgcolor="#FFCC66"><div align="center">村组</div></td>
<td width="125" nowrap="nowrap" bgcolor="#FFCC66"><p align="center">日交奶量</p></td>
<td width="112" nowrap="nowrap" bgcolor="#FFCC66"><p align="center">日期</p></td>
</tr>
<%count=0
totalcount=0
do while not rs.eof and count<rs.pagesize %>
<%if count Mod 2=0 then%><TR bgcolor="#E2EEFC" onMouseOver="this.style.backgroundColor='#FFDA6A'" onMouseOut="this.style.backgroundColor='#E2EEFC'">
<%end if%>
<td height="27" align="center" valign="middle" nowrap="nowrap"><%=count+1%></td>
<td align="center" valign="middle" nowrap="nowrap"><%=rs("xiangzhen")%></td>
<td align="center" valign="middle" nowrap="nowrap"><%=rs("cun")%></td>
<td align="center" valign="middle" nowrap="nowrap"><%=rs("rijiaonailiang")%></td>
<td align="center" valign="middle" nowrap="nowrap"><%=rs("riqi")%></td>
</tr>
<%
rs.movenext
count=count+1
loop
%>
</table>
<span class="style4">共有<%=rs.recordcount%>条记录,每页显示<%=rs.pagesize%>条 ,第<%=page%>/<%=rs.pagecount%>页
<%if page>1 then%>
<a href="rijiaonai2_hz.asp?Page=<% = 1%>&xiangzhen=<%=xiangzhen%>&nian=<%=nian%>&yue=<%=yue%>&ri=<%=ri%>&id=<%=id%>">首页</a><a href="rijiaonai2_hz.asp?Page=<% = 1%>"&xiangzhen=<%=xiangzhen%>&nian=<%=nian%>&yue=<%=yue%>&ri=<%=ri%>&id=<%=id%>"></a> <a href="rijiaonai2_hz.asp?Page=<% =page -1 %>&xiangzhen=<%=xiangzhen%>&ri=<%=ri%>&nian=<%=nian%>&yue=<%=yue%>&id=<%=id%>">上一页</a><a href="rijiaonai2_hz.asp?Page=<% =page -1 %>&xiangzhen=<%=xiangzhen%>&nian=<%=nian%>&yue=<%=yue%>&ri=<%=ri%>&id=<%=id%>"></a>
<%end if %>
<%if page<>rs.pagecount then %>
<a href="rijiaonai2_hz.asp?Page=<% =page + 1%>&xiangzhen=<%=xiangzhen%>&nian=<%=nian%>&yue=<%=yue%>&ri=<%=ri%>&id=<%=id%>">下一页</a><a href="rijiaonai2_hz.asp?Page=<% =page + 1%>&xiangzhen=<%=xiangzhen%>&nian=<%=nian%>&yue=<%=yue%>&ri=<%=ri%>&id=<%=id%>"></a> <a href="rijiaonai2_hz.asp?Page=<% = rs.PageCount%>&xiangzhen=<%=xiangzhen%>&nian=<%=nian%>&yue=<%=yue%>&ri=<%=ri%>&id=<%=id%>">">尾页</a><a href="rijiaonai2_hz.asp?Page=<% = rs.PageCount%>&xiangzhen=<%=xiangzhen%>&nian=<%=nian%>&yue=<%=yue%>&ri=<%=ri%>&id=<%=id%>"></a></span>
<% end if %>