<%sql="select * from news order by news_no desc"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,3,3
If IsNumeric(Request("Page"))=false Or Request("Page")="" Then
Page=1
Else
Page=CInt(Request("Page"))
End if
Rs.PageSize=3
If Rs.EOF Or Rs.BOF Then
Response.Write "目前还没有产品!"&"<br>"
Else
myPageSize=Rs.PageSize
Rs.AbsolutePage=Page
%>
<table>
<%Do While not Rs.Eof And myPageSize>0%>
<tr><td width=600> </td></tr>
<% myPageSize=myPageSize-1
i=i+1
Rs.MoveNext
Loop
%>
</table>
<%end if%>
产品总数:<%=Rs.RecordCount%>个;每页显示:<%=Rs.PageSize%>个;第<%=Page%>页/共<%=Rs.PageCount%>页.
<%
If Page > 1 Then
Response.Write "<a href='product.asp?Page=1' title='首页'><font face=webdings>" & 9 & "</font></a>"
Response.Write " <a href='product.asp?Page="&Page-1&"' title='上一页'><font face=webdings>" & 7 & "</font></a>"
End If
For j = 1 To Rs.PageCount
Response.Write " <a href='product.asp?Page="&j&"'>" & j & "</a>"
Next
If Page < Rs.PageCount Then
Response.Write " <a href='product.asp?Page="&Page+1&"' title='下一页'><font face=webdings>" & "8" & "</a></font>"
End If
Response.Write " <a href='product.asp?Page="&Rs.PageCount&"' title='尾页'><font face=webdings>:</a>"
%>
<%
Rs.Close
Set Rs=nothing
%>