+ -
当前位置:首页 → 问答吧 → asp出现这样错误应该怎么解决?

asp出现这样错误应该怎么解决?

时间:2011-06-23

来源:互联网

ADODB.Field 错误 '80020009' 

BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。 

行 0
HTML code

 <td align="center" valign="middle" bgcolor="#DEE7F7" ><%=conn.execute("select area from area where id="&rs("area")%></td>

 
现在已知是area造成的 问下怎么让area没有值的时候默认是1

作者: id270   发布时间: 2011-06-23

<%
dim area 
area = 1
if Not(Rs.EOF And Rs.BOF)
area = rs("area")
end if
response.write conn.execute("select area from area where id="&area
%>
试试看

作者: aspwebchh   发布时间: 2011-06-23

很简单啊 先做个判断 
if not rs("area")="" then
id=rs("area")
else id=1
end if
<%=conn.execute("select area from area where id="&id%>

作者: ma1986   发布时间: 2011-06-23

<%
dim area 
area = 1
if Not(Rs.EOF And Rs.BOF) then
area = rs("area")
end if
response.write conn.execute("select area from area where id="&area)
%>

作者: aspwebchh   发布时间: 2011-06-23

ADODB.Field 错误 '80020009'  

BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。  


这就是没有对应的记录。你要在之前判断一下。不要直接输出结果。

作者: tcwsyt   发布时间: 2011-06-23