回复 2# 的帖子
循环也限制了,不过是在另一个函数里.
sub class_detail_show(shopCartTableWidth,showProductRowNum,imageHeight,big_class_type,second_class_type,maxPerPage)
sql="select * from product_detail where "
if big_class_type<>"" then
sql=sql&"big_class_type='"&big_class_type&"'"
end if
if second_class_type<>"" then
sql=sql&" and second_class_type='"&second_class_type&"'"
end if
sql=sql&" order by id desc"
if not isempty(request.QueryString("pageNo")) then
pageNo=cint(request.QueryString("pageNo"))
else
pageNo=1
end if
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if err.number<>0 then
response.Write "数据库暂无纪录!"
response.End()
end if
if rs.eof and rs.bof then
response.Write "数据库无商品!"
response.End()
else
recordTotal=rs.recordcount
if pageNo<1 then pageNo=1
if (pageNo-1)*maxPerPage>recordTotal then
if (recordTotal mod maxPerPage)=0 then
pageNo=recordTotal\maxPerPage
else
pageNo=recordTotal\maxPerPage+1
end if
end if
if pageNo=1 then
second_class_type_content shopCartTableWidth,showProductRowNum,imageHeight,rs,bookmark
else
if (pageNo-1)*maxPerPage<recordTotal then
rs.move (pageNo-1)*maxPerPage
bookmark=rs.bookmark
response.Write bookmark&(pageNo-1)*maxPerPage
second_class_type_content shopCartTableWidth,showProductRowNum,imageHeight,rs,bookmark
else
pageNo=1
second_class_type_content shopCartTableWidth,showProductRowNum,imageHeight,rs,bookmark
end if
end if
end if
end sub