这段代码那里出错啦?

tmk2008 2008-04-22 11:42:43
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from Magazine where smallClassName='01' AND bigclassname=2008"
rs.open sql,conn,1,3
%>
<%=rs("Title")%>
<%=rs("Content")%>
<%rs.close
set rs=nothing%>
提示
ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
...全文
87 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
renping21051281 2008-04-22
  • 打赏
  • 举报
回复
conn 定义了吗?应该就是这个问题。
街头小贩 2008-04-22
  • 打赏
  • 举报
回复
看LZ不像这么马虎的人么?
竹林听雨2005 2008-04-22
  • 打赏
  • 举报
回复
提示这个错误的原因是因为记录不存在或未找到,
用if not rs.eof then来判断是否有记录,如果为false则就会出现上面这种现象了。
EexeNet 2008-04-22
  • 打赏
  • 举报
回复

<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from Magazine where smallClassName='01' AND bigclassname=2008"
rs.open sql,conn,1,3
%>
<%If not rs.eof then%>
<%=rs("Title")%>
<%=rs("Content")%>
<%rs.close
set rs=nothing%>

<%End if%>


mzcih 2008-04-22
  • 打赏
  • 举报
回复
没有符合的记录,用
While Not Rs.EOF
......
Wend
判断下。

28,409

社区成员

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

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