ASP 横列显示12个产品会少一个.

来源:百度知道 编辑:UC知道 时间:2024/06/06 06:42:57
<%
set RS=server.createobject("adodb.recordset")
if not isempty(request("page")) then
pagecount=cint(request("page"))
else
pagecount=1
end if
bookmark="no"
sql="Select * From Product Where"
If ProductType <>"全部类型" Then Sql =sql & " ProductType='"&ProductType&"' and"
IF KeyType<>"" and KeyWord<>"" Then sql =sql&" "&KeyType&" like '%"&KeyWord&"%' and"
if Right(sql,3)="and" then Sql = Left(sql,len(sql)-3)
if Right(sql,5)="Where" then Sql = Left(sql,len(sql)-5)
Sql=Sql & " Order By ProductName,ProductSmallType Desc"
RS.open sql,MyConn,1,3
RS.PageSize=12
if pagecount>rs.pagecount or pagecount<=0 then
pagecount=1
end if
if not(RS.bof or RS.eof) then
RS.AbsolutePage=pagecount
end if
%&

if i>=rs.PageSize then exit do
loop

看是不是这里的问题,把i>=12改为i>12

<%
i=0
do while not (rs.eof or rs.bof)
%>

<%
set RS=server.createobject("adodb.recordset")
if not isempty(request("page")) then
pagecount=cint(request("page"))
else
pagecount=1
end if
bookmark="no"
sql="Select * From Product Where"
If ProductType <>"全部类型" Then Sql =sql & " ProductType='"&ProductType&"' and"
IF KeyType<>"" and KeyWord<>"" Then sql =sql&" "&KeyType&" like '%"&KeyWord&"%' and"
if Right(sql,3)="and" then Sql = Left(sql,len(sql)-3)
if Right(sql,5)="Where" then Sql = Left(sql,len(sql)-5)
Sql=Sql & " Order By ProductName,ProductSmallType Desc"
RS.open sql,MyConn,1,3
RS.Page