帮忙啊,大侠们
我在做购物系统的时候,涉及到了分页技术
此程序再ASP+ACCESS通过
但是数据库该换为 SQL SERVER 出现错误
出现错误
错误类型:
ADODB.Recordset (0x800A0BB9)
/xysc/sort.asp, 第 44 行
请教大侠
代码如下
<%sort_id=trim(request("sort_id"))
if sort_id=empty then
response.redirect "index.asp"
end if
page=request.querystring("page")
if page="" then page=1
if not(isnumeric(page)) then page=1
if page<1 then page=1
page=int(page)
sql="select * from hw where sort_id='"&sort_id&"' order by hw_id DESC"
rs.open sql,conn,3,3
if rs.eof then
response.write "你所选的类别没有商品"
response.end
else
rs.pagesize=12
totalrec=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then page=totalpage
rs.absolutepage=page /*44行*/
rs.cachesize=rs.pagesize
i=0
dim hw_id(),hw_name(),hw_cash(),hw_views(),hw_buys(),hw_content(),hw_pic(),hw_date()
do while not rs.eof and (i<rs.pagesize)
i=i+1
redim preserve hw_id(i),hw_name(i),hw_cash(i),hw_views(i),hw_buys(i),hw_content(i),hw_pic(i),hw_date(i)
hw_id(i)=rs("hw_id")
hw_name(i)=rs("hw_name")
hw_cash(i)=rs("hw_cash")
hw_views(i)=rs("hw_views")
hw_buys(i)=rs("hw_buys")
hw_content(i)=rs("hw_content")
hw_pic(i)=rs("hw_pic")
hw_date(i)=rs("hw_date")
rs.movenext
loop
end if
rs.close
%>
此程序再ASP+ACCESS通过
但是数据库该换为 SQL SERVER 出现错误
出现错误
错误类型:
ADODB.Recordset (0x800A0BB9)
/xysc/sort.asp, 第 44 行
请教大侠
代码如下
<%sort_id=trim(request("sort_id"))
if sort_id=empty then
response.redirect "index.asp"
end if
page=request.querystring("page")
if page="" then page=1
if not(isnumeric(page)) then page=1
if page<1 then page=1
page=int(page)
sql="select * from hw where sort_id='"&sort_id&"' order by hw_id DESC"
rs.open sql,conn,3,3
if rs.eof then
response.write "你所选的类别没有商品"
response.end
else
rs.pagesize=12
totalrec=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then page=totalpage
rs.absolutepage=page /*44行*/
rs.cachesize=rs.pagesize
i=0
dim hw_id(),hw_name(),hw_cash(),hw_views(),hw_buys(),hw_content(),hw_pic(),hw_date()
do while not rs.eof and (i<rs.pagesize)
i=i+1
redim preserve hw_id(i),hw_name(i),hw_cash(i),hw_views(i),hw_buys(i),hw_content(i),hw_pic(i),hw_date(i)
hw_id(i)=rs("hw_id")
hw_name(i)=rs("hw_name")
hw_cash(i)=rs("hw_cash")
hw_views(i)=rs("hw_views")
hw_buys(i)=rs("hw_buys")
hw_content(i)=rs("hw_content")
hw_pic(i)=rs("hw_pic")
hw_date(i)=rs("hw_date")
rs.movenext
loop
end if
rs.close
%>
...全文


