ADODB.recordset操作时却只有-1条记录,说明并没有找到所需要的记录集

解决方案 »

  1.   

    With Rs
       '使recordcount>0 
       .CursorLocation = adUseClient  
       .CursorType = adOpenStatic 
       '可以修改和保存    
       .LockType = adLockOptimistic
    End With
      

  2.   

    可能是ado設置有問題
    rs.CursorLocation = adUseClient 
    rs.open sql,conn,adOpenKeySet,adLockOptimistic,adCmdText
      

  3.   

    cn.open "........."
    rs.open "select min(办单号) as aa, 颜色 , sum(数量) as bb from  (select * from design_zs_color where 办单号='dfg' union all select * from design_bj_color where 办单号='dfg')  as UnionTbl group by 颜色",cn,1,3
    do whiule not rs.eof
       msgbox rs(0)
       rs.movenext
    loop
    rs.close
    cn.close
    set rs=nothing
    set cn=nothing
     
      

  4.   

    检查bof和eof,if not bof then movefirst
    还有估计和CursorLocation有关