帮我看一下下面一段asp代码的错误在哪?

我思路是这样的用一行两列的表格,左边显示标题,有相应的超链在右边的单元格显示,如下:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><%dim conn,strstr="driver={sql server};server=.;database=111;uid=sa;pwd=123456;"set conn=server.CreateObject("adodb.connection")conn.open str%><%title=trim(request("title"))set rs=server.CreateObject("adodb.recordset")sqlstr="select * from news where title=✀"&title&"✀"rs.open sqlstr,conn,1,3do while not rs.eof %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title></head><body><table width="70%" border="1"> <tr> <td width="29%" height="114"><a href="untitled-1.asp?Title=<%=rs("Title")%>"><%=rs("Title")%></a></td> <%rs.movenext loop %> <td width="71%"><%=rs("content")%></td> </tr></table></body><%rs.closeset rs=nothingconn.close%></html>说明一下,数据库名“111”,数据表“news”,包含字段“title”(也就是左边显示的)和“content”(选择左边的title显示到右边的表格的内容)错误如下:ADODB.Field 错误 ✀80020009✀ BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。 ⼀Untitled-1.asp,行 0
2026年09月20日 01:35
有4个网友回答
网友(1):

出现什么错误提示?楼主要说清楚啊.

网友(2):

<%Do While Not Rs.Eof%>
图片内容
<%Rs.MoveNext
Loop%>

你上面的乱七八糟的。像我这样弄才行。

你数据库里没有记录

网友(3):

需要打开两个记录集,否则实现不了你要的效果~!

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
dim conn,str
str="driver={sql server};server=.;database=111;uid=sa;pwd=123456;"
set conn=server.CreateObject("adodb.connection")
conn.open str
%>




无标题文档



<%
set rs=server.CreateObject("adodb.recordset")
sqlstr="select * from news"
rs.open sqlstr,conn,1,1
%>








<%do while not rs.eof%>



<%rs.movenext
loop
rs.close
set rs=nothing
%>
"><%=rs("Title")%>
<%
title=trim(request("title"))
if title<>"" then
set rs1=server.CreateObject("adodb.recordset")
sqlstr="select * from news where title='"&title&"'"
rs1.open sqlstr,conn,1,1
Response.Write rs1("content")
rs1.close
set rs1=nothing
end if
%>

<%
conn.close
Set conn=Nothing
%>

网友(4):

在do while not rs.eof 上加判断
if not (rs.eof or rs.bof) then
do while..........

end if即可