回 帖 发 新 帖 刷新版面

主题:提示出错,为何?

代码:
set rsyfindex = Server.CreateObject("adodb.recordset")
rsyfindex.open "select * from yfindex where subid="&subid&"",conn,1,1

Dim sql

if rsyfindex("retime") <> "" then         ---101行
   sql = "select * from yfindex where subid ="& subid &" and Day(retime) >=Day(getdate())"
else
  sql = "select * from yfindex where subid="&subid & " and Day(initime) >=Day(getdate())"
end if

为啥出现错误提示:
错误类型:
(0x80020009)
发生意外。 
/bbs/inc/function.asp, 第 101 行

回复列表 (共1个回复)

沙发

应该事先判一下是否有记录,否则如果取到了空记录这里就出错了
if not rsyfindex.eof then
   ......
end if

我来回复

您尚未登录,请登录后再回复。点此登录或注册