求助ASP分页问题
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!--#include file=conn.asp-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
background-color: #99CCFF;
}
-->
</style></head>
<body>
<%dim newsXiaoleiID
newsXiaoleiID=request.QueryString("id")
sql="select * from shop_news where newsXiaoleiID="&newsXiaoleiID&" order by newsid desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
if not isempty(request("page")) then
pagecount=cint(request("page"))
else
pagecount=1
end if
n=1
rs.pagesize=50
rs.AbsolutePage=pagecount
filename="newsMX5.asp"
%>
<table width="311" border="0" align="center">
<%
do while not rs.eof
%>
<tr>
<td width="305"><font color="#0099CC"><font color="#666666"><img src="images/top2.gif" width="12" height="13"><a href=news.asp?id=<%=rs("newsid")%> target="_blank"> <%=rs("newsname")%></a></td>
</tr>
<%
rs.movenext
n=n+1
if n>rs.pagesize then exit do
loop
%>
</table>
<table width="535" border="0" cellspacing="0" cellpadding="0" align="center">
<form action="<%=filename%>" method="post">
<tr bgcolor="#B0CCDC">
<td height="35" bgcolor="#FFFFFF">
<div align="center"> <font size="2" face="黑体" class="a">共 <b><%=rs.recordcount%></b> 条记录, 页次: <b><font color=red><%=pagecount%></font>/<%=rs.pagecount%></b>,
<% if pagecount=1 and rs.pagecount<>pagecount and rs.pagecount<>0 then%>
<a href="<%=filename%>?page=<%=cstr(pagecount+1)%>" class="a">[下一页]</a>
<% end if %>
<% if rs.pagecount>1 and rs.pagecount=pagecount then %>
<a href="<%=filename%>?page=<%=cstr(pagecount-1)%>" class="a">
[上一页]</a>
<%end if%>
<% if pagecount<>1 and rs.pagecount<>pagecount then%>
<a href="<%=filename%>?page=<%=cstr(pagecount-1)%>" class="a">
[上一页]</a> <a href="<%=filename%>?page=<%=cstr(pagecount+1)%>" class="a">
[下一页]</a>
<% end if%>
直接到第
<select name="page">
<%for i=1 to rs.pagecount%>
<option value="<%=i%>"><%=i%></option>
<%next%>
</select>
页
<input type="submit" name="go" value="Go">
</font></div>
</td>
</tr>
</form>
</table>
</body>
</html>
我是菜鸟
说明:1接收上页参数newsXiaoleiID
2.where newsXiaoleiID="&newsXiaoleiID&"分页不正常.点下页时提示语法错误 (操作符丢失) 在查询表达式 'newsXiaoleiID=' 中。
3.改成where newsXiaoleiID=15时分页正常.
4.很明显newsXiaoleiID的值在点下页时没有传过去.故提示语法错误 (操作符丢失) 在查询表达式 'newsXiaoleiID=' 中。
如何解决问题,请各位高手赐教,不胜感谢!!