asp分页问题,求高手解答

来源:百度知道 编辑:UC知道 时间:2024/05/13 16:47:11
各位高人, 小弟有一页代码,显示为全部产品,现在想分页显示,每页显示8个,请问如何改?谢谢了!
代码如下:
<body>
<!--#include file="inc/logotop.asp" -->
<!--#include file="inc/sys.asp"-->
<%
call checkform()
ProductClass=request("ProductClass")
ClassName=request("ClassName")

if productclass = "" then
set rsc=conn.execute("select top 1 * from tproductclass where ver=0 order by sortno")
call DoError()
if not rsc.eof then
productclass = rsc("classid")
classname = rsc("classname")
end if
rsc.close()
set rsc = nothing
end if

sql = "select * from tproduct where ver=0 "
if ProductClass <> "" then
sql = sql & " and ProductClass="&cstr(ProductClass)
end if
sql = sql & " order by sortno"
set rs=conn.execute(sql)
call DoError()

<body>
<!--#include file="inc/logotop.asp" -->
<!--#include file="inc/sys.asp"-->
<%
sub titlen(i)
tlen=rs("topic")
if len(tlen)>i then
tlen=left(tlen,i)&"..."
else
tlen=tlen
end if
end sub
'设置每页显示数量
Const PAGESIZE=8
'设置略显示多少页
Const PARTSIZE=10
dim tlen
tlen=""
AProductClass=trim(request("ProductClass"))
dim pagecount,page,Spage,Epage,recordcount,i
page = request.querystring("page")
if page = "" or IsNull(page) then page = 1
if not IsNumeric(page) then page = 1
page = Cint(page)
%>

<%
call checkform()
ProductClass=request("ProductClass")
ClassName=request("ClassName")

if productclass = "" then
set rsc=conn.execute("select top 1 * from tproductclass where ver=0 ord