让我郁闷了一上午的 ASP分页

来源:百度知道 编辑:UC知道 时间:2024/05/15 16:39:37
<TD>
<%
typeid=request("typeid")
if typeid="" then
typeid="无锡商贸"
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from xibu where type='"&typeid&"' order by time desc ",conn,1,1
%>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD height="300" align="left" valign="top">
<%do while not rs.eof%>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="17" align="left" valign="top"><img src="img/item_04.gif" width="15" height="15"></td>
<td height="20" align="left" valign="top"><a href="news_view.asp?id

如果是菜鸟的话。建议下载一个ASP通用分页类。很方便。
如果非要自已写的话。可以用一种简单的方法
数据库写一个ID字段,但是不是自动编号的。每添一条记录的时候,ID字段的值添入条目的数量。
分页的时候。

cunt是每页多少条
sql="select top "&cunt&" from XXX where id> " & request("page") &" and id<" &request("page") "