首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

判断一个记录集为空的两种方法那个好?该如何处理

2012-01-30 
判断一个记录集为空的两种方法那个好?判断一个记录集为空用下面的那个好?ifrs.bofandrs.eofthenresponse.w

判断一个记录集为空的两种方法那个好?
判断一个记录集为空用下面的那个好?
if rs.bof and rs.eof then 
  response.write "empty " 
end if
...............................................
if rs.recordcount=0 then
 
response.write "empty " 

end if

[解决办法]
if rs.recordcount=0 then

[解决办法]
第一种好,对于服务器游标和客户端游标都通用
[解决办法]
if rs.bof and rs.eof then

这种好一点,有时候会出现本无记录,但是rowcount =1的情况,这跟SQL写法和不同的库有关系。
[解决办法]
rs.recordcount=0

热点排行