已有一下操作,怎样得到返回记录的总数?
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb;Persist Security Info=False"Adodc1.RecordSource = "select * from 表1"Set DataGrid1.DataSource = Adodc1

解决方案 »

  1.   

    msgbox Adodc1.Recordset.RecordCount
      

  2.   

    之前最好
    Adodc1.Recordset.movelast
    Adodc1.Recordset.movefirst一下
      

  3.   

    Adodc1.CursorLocation = adUseClient或者
    Adodc1.CursorType = adOpenStatic
    如下:Adodc1.CursorLocation = adUseClient
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select * from PROCEED"
        Adodc1.Refresh
        MsgBox Adodc1.Recordset.RecordCount
      

  4.   

    Debug.Print Adodc1.Recordset.RecordCount
      

  5.   

    Adodc1.Recordset.movelast
    Adodc1.Recordset.movefirst一下///這話不錯,呵呵,小心報告-1的情況
      

  6.   


    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb;Persist Security Info=False"Adodc1.RecordSource = "select * from 表1"Set DataGrid1.DataSource = Adodc1
    Adodc1.Recordset.movelast
    Adodc1.Recordset.movefirst
    msgbox "共有" & Adodc1.Recordset.recordcount & "条记录!!!"
      

  7.   

    可是我加了:  
    msgbox Adodc1.Recordset.RecordCount   
    后提示:“对象变量或With块变量未设置”??
      

  8.   

    Adodc1.Recordset.RecordCount:“对象变量或With块变量未设置”??大哥,你引用了Adodc1控件了吗?????