ASP语句问题!求解

来源:百度知道 编辑:UC知道 时间:2024/05/27 01:36:07
<%
Const MaxPerPage=40
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(SafeRequest("page",1)) then
currentPage=Cint(SafeRequest("page",1))
else
currentPage=1
end if

set rs=server.CreateObject("adodb.recordset")
rs.open "select prename,company,mark,intro,name,id,introduce,price1,price2,discount,pic,stock,spic from product where categoryid in ("& CatList&") and stock >= 0 and recommend<>3 order by adddate desc",conn,1,1
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if

if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if

if currentPage=1 then
showContent
showpage totalput,MaxPe

BS AD and ctrl+V

如果一条记录就是一个产品
rs.pagesize=40

response.write "<table><tr>"
for t=1 to 40
response.write"<td>"&rs.fields.item("yourFields")&"</td>"
if (t mod 4)=0 then
response.write "</tr><tr>"
end if
next