初学者提问:记录集分页显示问题

onlycoding 2001-11-17 03:56:02
只要在程序中加入
rs.pagesize=10 语句、浏览时就出现如下错误:
----
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'

ODBC 驱动程序不支持需要的属性。

/dbs/index.asp, 行12
-----

环境:win98 + pws

请各位大虾快快帮忙解答,先谢了

整个源程序如下:


<%@ Language=VBScript %>
<!--#include file="conn.asp"-->
<%
dim curpage
dim rs
set rs = server.createobject("adodb.recordset")

sql="select"

sql=sql&"download.images,download.id,download.showname,download.dateandtime,
download.hits,download.classid,download.Nclassid,Nclass.Nclass,download.syst
em,download.orders,download.fromurl,download.note"
sql=sql&" from download,Nclass where download.hits > 500 and
download.Nclassid=Nclass.Nclassid"
sql=sql&" order by download.hits desc"
rs.open sql,conn,1,1

rs.pagesize = 10
%>
<HTML>
<HEAD>
<title>Untitled Document</title></HEAD>
<BODY bgcolor="#F0F0F0" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0">
<%
if not isempty(request("topage")) then
topage=cint(request("topage"))

if topage <= 0 then
rs.absolutepage = 1
end if
if topage > rs.pagecount then
rs.absolutepage = rs.pagecount
end if
end if

curpage = rs.absolutepage
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0"
height="100%">
<tr>
<td height="8" width="3%"> </td>
<td height="8" width="95%">
<%if rs.eof and rs.bof then
%>
没有任何纪录 </td>
<td height="8" width="2%"> </td>
</tr>
<tr>
<td width="3%"> </td>
<td width="95%">
<%else%>
<table width="100%" border="1" align="center" cellpadding="1"
cellspacing="1" bgcolor="#FFFFFF" bordercolor="#006633" height="100%">
<tr bgcolor="#999933">
<td width="17%"><font color="#003333">id</font></td>
<td width="24%"><font color="#003333">showname</font></td>
<td width="17%"><font color="#003333">fromurl</font></td>
<td width="25%"><font color="#003333">images</font></td>
<td width="17%"><font color="#003333">hits</font></td>
</tr>
<%'do while not rs.eof
for i =1 to rs.pagesize
if rs.eof then
exit for
end if%>
<tr>
<td width="17%"><font color="#006666"><%=rs("id")%></font></td>
<td width="24%"><font
color="#006666"><%=rs("showname")%></font></td>
<td width="17%"><font
color="#006666"><%=rs("fromurl")%></font></td>
<td width="25%"><font color="#006666"><img src=<%=rs("images")%>
border="0" align="middle"></font></td>
<td width="17%"><font color="#006666"><%=rs("hits")%></font></td>
<br>
<%
rs.movenext
next
end if
'rs.close
%>
</table>
</td>
<td width="2%"> </td>
</tr>
</table>
<P></P>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
if curpage <> 1 then
%>
<tr>
<td width="27%"><a href=index.asp?topage=<%=1%>>第一页</a></td>
<td width="27%"><a href=index.asp?topage=<%=curpage-1%>>上一页</a></td>
<% end if
if curpage <> rs.pagecount then
%>
<td width="27%"><a href=index.asp?topage=<%=curpage+1%>>下一页</a></td>
<td width="14%"><a href=index.asp?topage=<%=rs.pagecount%>>末页</a></td>
<td width="5%">
<form name="form1" method="post" action="INDEX.ASP">
<input type="text" name="topage" value="<%=curpage%>">
</form>
</td>
</tr>
</table>
<%
end if
rs.close
set rs=nothing
%>
</BODY>
</HTML>


...全文
56 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
karma 2001-11-17
  • 打赏
  • 举报
回复
set rs = server.createobject("adodb.recordset")
rs.cursorlocation=3 'aduseclient

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧