[求助]菜鸟求教分页中出现问题“当前提供程序不支持从单一执行返回多个记录集。”问
ADODB.Recordset 错误 '800a0cb3'当前提供程序不支持从单一执行返回多个记录集。
源码如下:
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("szlyb.mdb")
exec="select * from guestbook order by ID DESC"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
PgSz=20
If RS.RecordCount=0 then
response.write "<P><center>对不起,数据库中没有相关信息!</center></P>"
else
RS.PageSize = Cint(PgSz)
Total=INT(RS.recordcount / PgSz * -1)*-1
PageNo=Request("pageno")
if PageNo="" Then
PageNo = 1
else
PageNo=PageNo+1
PageNo=PageNo-1
end if
ScrollAction = Request("ScrollAction")
if ScrollAction = " 上一页 " Then
PageNo=PageNo-1
end if
if ScrollAction = " 下一页 " Then
PageNo=PageNo+1
end if
if PageNo <1 Then
PageNo = 1
end if
n=1
RS.AbsolutePage = PageNo
Response.Write "<CENTER>"
position=RS.PageSize*PageNo
pagebegin=position-RS.PageSize+1
if position <RS.RecordCount then
pagend=position
else
pagend= RS.RecordCount
end if
Response.Write "<P><font color='Navy'><B>数据库查询结果:</B>"
Response.Write "(共有"&RS.RecordCount&"条符合条件的信息,显示"&pagebegin&"-"&pagend&")</font></p>"
Response.Write "<TABLE WIDTH=600 BORDER=1 CELLPADDING=4 CELLSPACING=0 BGCOLOR=#FFFFFF>"
Response.Write "<TR BGCOLOR=#5FB5E2><FONT SIZE=2><TD><B>主题</B></TD><TD><B>用户</B></TD><TD><B>Email</B></TD><TD><B>发布日期</B></TD></FONT><TR BGCOLOR=#FFFFFF>"
Do while not (RS is nothing)
RowCount = RS.PageSize
Do While Not RS.EOF and rowcount > 0
If n=1 then
Response.Write "<TR BGCOLOR=#FFFFFF>"
else
Response.Write "<TR BGCOLOR=#EEEEEE>"
end if
n=1-n
%>
<td><%=rs("user")%></td>
<td><%=rs("title")%></td>
<td><%=rs("message")%></td>
<td><%=rs("time")%></td>
</tr>
<%
RowCount = RowCount - 1
RS.MoveNext
Loop
set RS = RS.NextRecordSet
loop
Conn.Close
set rs = nothing
set Conn = nothing
%>
说到“set RS = RS.NextRecordSet ”就有上面的问题,小生初学,请高手详解阿,下辈子作牛做马报答。
[此贴子已经被作者于2005-12-27 18:27:56编辑过]