当前记录集不支持书签

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
...全文
32 点赞 收藏 1
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
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
%>
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2008-04-04 12:59
社区公告
暂无公告