用 if rs.eof then ……试试

解决方案 »

  1.   

    if rs.bof and rs.eof then 
        ....
    end if或者
    if rs.recordcount=0 then (只法不安全)
      

  2.   

    请问如何删除合符条件的数据啊。
    Text1.Text=3
    rs.Open "select * from pp where id=" & Text1.Text, cn, 1, 1
    比如说现在找到了ID=3的记录了,接着如何写。
      

  3.   

    (Access):
    cn.execute "delete * from pp where id="& Text1.Text
    (sqlServer):
    cn.execute "delete pp where id="& Text1.Text
    rs.close
      

  4.   

    if rs.eof=true or rs.bof=true then '表示没有找到elseendif
      

  5.   

    if rs.eof=true or rs.bof=true then '表示没有找到else
      
        do while rs
           if rs.fields("id")="3" then
              rs.delet
              rs.update
           endif
    endif
      

  6.   

    if rs.eof=true or rs.bof=true then '表示没有找到else
      
        do while rs
           if rs.fields("id")="3" then
              rs.delet
              rs.update
           endif
           rs.movenext
        loop
    endif
      

  7.   

    If rs.RecordCount <> 0 Then
        MsgBox "找到了"
      Else
      MsgBox "数据库错误", vbExclamation, "错误"
      End If
    若是找到,则记录个数一定大于0,否则小于0。这可以吗?
      

  8.   

    同意(olianan)剑琴的跟贴,我也是这么解决的。
      

  9.   

    一定注意你的数据库链接cnn的游标是否为客户端游标否则,你的当前记录数等问题都会出问题。