asp中,数据库是空值,怎么采用

来源:百度知道 编辑:UC知道 时间:2024/05/22 20:01:47
假如
sql="select * from aa where name='我'"
rs.open sql,conn,2,3 '这里没有满足条件的数据

怎么让它正常运行??????
if rs("id")="" then
a=1
else
a=2
end if
在没有满走条件数据时,在王页中,他总是提示不能为bof或eof,所以不能正常运行? 是否在指针那能调整

呵呵 个人建议 希望有帮助!
如下:

可以在rs.open sql,conn,2,3 执行完加以判断

用if not rs.eof and not rs.bof then

else

eng if

not rs.eof and not rs.bof这句的意思是已经在数据库读出符合你条件的数据了 不要not就是没有读出

呵呵 可以试试看哦

还需要帮助给我百度消息!

愿早日搞定代码!

既然没有满足的条件 你直接用rs("id")有问题

可以先判断一下

if rs.recordcount = 0 then
if rs("id")="" then
a=1
else
a=2
end if
else

end if