当前记录集不支持书签

kkkgho 2008-04-04 12:59:47
我想随机读取数据库的数据,但是为什么rs.absoluteposition=x这样会出错呢??


<%
response.buffer=false
Set CONN=Server.CreateObject("ADODB.Connection")
CONN.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&Server.Mappath("db18.mdb")
SQL = "SELECT * FROM tk"
Set rs = CONN.Execute ( SQL )
%>
<%
for i = 1 to 10
%>
<%
Randomize
x = int(rnd()*3000)
response.write (rs("tm") & x)
rs.absoluteposition=x

%>
<br>
<br>
<form name="form1" method="post action="">
<label>
<input type="radio" name="radiobutton" value="1">
A
</label>
<label>
<input type="radio" name="radiobutton" value="2">
B
</label>
<label>
<input type="radio" name="radiobutton" value="3">
C
<input type="radio" name="radiobutton" value="4">
D
</label>
<input name="hiddenField" type="hidden" value="<%=rs("th")%>">
</form>
<%
next
%>


ADODB.Recordset 错误 '800a0cb3'

当前记录集不支持书签。这可能是提供程序或选定的游标类型的限制。

/zhishi/index.asp,行 15
...全文
77 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2008-04-04
  • 打赏
  • 举报
回复
<%
response.buffer=false
Set CONN=Server.CreateObject("ADODB.Connection")
CONN.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&Server.Mappath("db18.mdb")
SQL = "SELECT * FROM tk"
Set rs = CreateObject("ADODB.RecordSet")
rs.open SQL, CONN, 1, 3
%>

<%
for i = 1 to 10
%>

<%
Randomize
x = int(rnd()*3000)
response.write (rs("tm") & x)
rs.absoluteposition = x
%>

<br>
<br>
<form name="form1" method="post action="">
<label>
<input type="radio" name="radiobutton" value="1">
A
</label>
<label>
<input type="radio" name="radiobutton" value="2">
B
</label>
<label>
<input type="radio" name="radiobutton" value="3">
C
<input type="radio" name="radiobutton" value="4">
D
</label>
<input name="hiddenField" type="hidden" value=" <%=rs("th")%>">
</form>
<%
next
%>

28,409

社区成员

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

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