例如 我有11条纪录,设定为每页10条``就算我用 movelast到纪录集的最后开始,第一页也只有一条纪录,第二页才是10条纪录.请问应该怎么做才能使分页的时候纪录由最后一条纪录开始算起.也就是说象上面提到的状况,第一页是最新的10条,第二页是最老的一条.``````
<table width="100%" height="97" cellpadding="0" cellspacing="0" bordercolor="0">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from law order by addtime desc"
rs.open sql,conn,1,3
if rs.eof then
response.write"没有数据"
response.End()
end if
rs.PageSize =15
page = CLng(Request.QueryString("page"))
If page < 1 Then
page = 1
End If
If page > rs.PageCount Then
page = rs.PageCount
End If
rs.AbsolutePage = page
For i = 1 To rs.PageSize
varNo = (page - 1) * rs.PageSize + i
%>
<tr>
<td width="14%">
<table width="100%" cellSpacing=0 cellPadding=0 bordercolor="#ffcc66" border=1 bordercolordark="#FFFFFF">
<tr>
<td width="603" class="style20">问:<a href="law.asp?id=<%=rs("id")%>" target="_blank"><%=left(rs("title"),50)%></a></td>
</tr>
<tr>
<td width="603"><span class="style20">答:<a href="law.asp?id=<%=rs("id")%>" target="_blank"><%=rs("reply")%></a></span></td>
</tr>
</table>
<span class="style10"><br>
</span></td>
</tr>
<%
rs.MoveNext
varNo=varNo+1
If rs.EOF Then Exit For
next
%>
<tr>
<td height="47" colspan="2">
<div align="center"><span class="style20">【共<%= rs.recordcount %>条<%= rs.pagecount %>页 当前<%= page %>/<%= rs.pagecount %>】
<%
If page = 1 Then
Response.Write("第一页 ")
Else
Response.Write("<a href=fulllaw.asp?page=1>第一页</a>")
End If
If page = 1 Then
Response.Write(" 上一页 ")
Else
Response.Write("<a href=fulllaw.asp?page=" & page-1 & ">上一页</a> ")
End If
If page = rs.PageCount Then
Response.Write("下一页 ")
Else
Response.Write("<a href=fulllaw.asp?page=" & page+1 & ">下一页</a>")
End If
If page = rs.PageCount Then
Response.Write("最后一页 ")
Else
Response.Write("<a href=fulllaw.asp?page=" & rs.PageCount &"> 最后一页</a>")
End If
%>
</span></div></td>
</tr>
</table>
我就是用这个的,很好用的