先查看RST中是否有記錄,如無記錄那就會報錯.
   if rst.recordcount=0 then 無記錄msgbox("出錯").

解决方案 »

  1.   

    感谢你的好意:
        我是在用下一条或上一条时防错的!
        if rs.recordcount>1 then
         if not rs.eof then
          rs.movenext
         endif
       endif
    但是还会出现错误!
      

  2.   

    使用如下代码试一试:
    dim I as long
    for I=0 to rs.recordcount-1
        rs.movenext
    next I
      

  3.   

    哦,我知道了.
    采用變量 
    首記錄時 flageof=1
    if flageof=rs.recordcount then
       "已是最后一條記錄" 
      else 
        rs.movenext
        flageof=flageof+1
    end if 
      

  4.   

    recordcount 不一定有用!
    判断数据库为空的方法:
    if rst.bof =true and rst.eof =true