不要使用rs.recordcount作判断,应使用
if rs.eof then
  '没有记录
endif

解决方案 »

  1.   

    fs_windy(飛龍):
    if rs.eof then 
    exit sub 
    else
    也不行,因为空记录也是一个记录呀,请各位帮忙!!
      

  2.   

    fs_windy(飛龍):
    if rs.eof then
      '没有记录
    endif
    也不行,因为空记录也是一个记录呀,请各位帮忙!!
      

  3.   

    什么 IF RS.RECORDCOUNT=0 
    什么 IF RS.FIELDS(0)=NULL 我都用过,这样应该可以的:dim a as string
    a=rs.fields(0)
    a=a & " "
    if len(trim(a))=0 then
    msgbox "没有记录"
    else
    a=len(trim(a))
    end if