这个分页怎么一点也次或者下一页就到最后一页呢,知道的帮帮我啊,
set rs= Server.CreateObject("ADODB.RecordSet")
rs.Open sql, Conn, 1, 2
page=Request("page")
if page=0 then
page=1
end if
RecordCount = 0
do while not rs.Eof
RecordCount = RecordCount +1
rs.MoveNext
loop
if not RecordCount=0 then
rs.MoveFirst
end if
pageCount=RecordCount/25
pageCount=int(pageCount)
if (RecordCount mod 25)>0 then
PageCount=PageCount +1
end if
if pagecount=0 then pagecount=1
if page>pagecount then page=pagecount
do while pos<(page-1)*25
pos=pos+1
rs.moveNext
loop
x=0
do while x<25 and not rs.eof%>
<tr bgcolor="#FFFFFF">
<td align="center" width="30">
<%if rs("gd")=1 then
response.write"<img src=""images/istop.gif"" alt=""固顶帖子""> "
elseif rs("jh")=1 then
response.write"<img src=""images/isbest.gif"" alt=""精华帖子""> "
elseif rs("jh")=0 and rs("hits")<50 then
response.write"<img src=""images/folder.gif"" alt=""普通帖子"">"
elseif rs("jh")=0 and rs("hits")>=50 then
response.write"<img src=""images/hotfolder.gif"" alt=""热门帖子"">"
elseif rs("jh")=2 then
response.write"<img src=""images/lockfolder.gif"" alt=""锁定帖子""> "
end if%>
</td>
<td height="30" width="*" onMouseOver="this.bgColor = '#f0f0f0'" onMouseOut="this.bgColor = '#DAEDF5'" bgcolor="#DAEDF5" >
<img src="images/nofollow.gif" vspace="2"><a href="show.asp?id=<%=rs("id")%>"><%=rs("title")%></a>
</td>
<td align="center" bgcolor="#92C8E2" width="84">
<% if rs("bl")=1 then %>
<%=rs("user_name")%>
<%else%>
<%=rs("user_name")%>
<%end if%>
</td>
<td align="center" width="69" bgcolor="#DAEDF5"> <%=rs("hf")%>/<%=rs("hits")%></td>
<td bgcolor="#92C8E2" width="195"> <%=rs("tt")%>|<%=rs("hfren")%></td>
</tr>
<%x=x+1
rs.movenext
loop
rs.close
set rs=nothing
%>
</table>
<table width="98%" border="0" align="center" cellspacing="0" cellpadding="3" bgcolor="#205E7B">
<form method=post action=index.asp>
<tr>
<td width="52%" class=td1>页次:
<%if page="" then
response.write"1"
else
response.write page
end if%>
/ <%=pageCount%> 页 主题数:<%=RecordCount%></td>
<td width="48%" align="right" class=td1>
<%if page=1 then
response.write"首页"
else
response.write"<a href=index.asp class=a1>首页</a> "
end if%>
<%if page=1 then %>
上一页
<%else%>
<a href="index.asp?page=<%=page-1%>" class=a1>上一页</a>
<%end if%>
<% y=1%>
<%do while y<pagecount+1%>
<a href="index.asp?page=<%=y%>" class=a1><%=y%></a>
<%
y=y+1
loop%>
<%if cint(page)=pagecount then %>
下一页
<%else%>
<a href="index.asp?page=<%=page+1%>" class="a1">下一页</a>
<%end if%>