判断一个记录集为空的两种方法那个好?
判断一个记录集为空用下面的那个好?
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