急!!!!!!!!!!!求解分页显示的问题!!
若哪位大哥帮我解答了,给您加N多的分!谢谢了!!谢谢!!
这里一共有二段程序:
第一段:
<%'开始分页
Const MaxPerPage=8
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select top 100 sclassid from sclass ",conn,1,1
if rs.eof And rs.bof then
Response.Write "<p align='center' class='contents'> 对不起,目前没有更新商品!</p>"
else
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,MaxPerPage,"sclass.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"sclass.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"newshop.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
<%do while not rs.eof%>
第二段:不用了,这个没有问题的。
我想问的是第一段里的
rs.open "select top 100 sclassid from sclass ",conn,1,1
这里是怎么加的?
我的这个页叫sclass.asp
用在数据库里的是一个叫sclass的表,里面有如下字段:
sclassid,bclassid,sclassname,sclassjs,sclassimg,sclassimg2,sclassimg3,sclassimg4,sclassimg5,sclassimg6
sclassid是小类商品的号,bclassid是大类商品的号,sclassname是名称,sclassjs是介绍,其它是图片
请问怎么加才能分页显示我的商品啊?
谢谢大家了!!!!