主题:  怎样正确判断记录集是否为空?

zjlzh

职务:普通成员
等级:1
金币:0.0
发贴:87
注册:2002/10/3 16:21:18
#12002/10/22 16:27:08
我做一个单词查询模块,当条件符合时,查询结果正确显示;但当单词不存在时,细节页中显示错误:
ADODB.Recordset 错误 '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/Word.asp, 行63
我知道是空记录集,但不知怎样预先检测并在某个地方插入提示信息,然后返回调用页面。我该怎样做?
我的所有ASP页都是DU自动生成的。



5D荣誉斑竹

职务:普通成员
等级:2
金币:10.0
发贴:710
注册:2001/10/24 18:34:42
#22002/10/22 18:20:31
在记录集的下面写:
<%
if rs.eof and rs.bof then
Response.Write "记录为空
"
Response.Write "请单击 这里 返回"
Response.end
end if
%>

rs表示记录集的名称