老兄你的写法我没见过:
我一般这样定义
dim dynrecordset as new recordset
Dim ADOCnn As New ADODB.Connection
然后赢SQL语句打开记录机
看:dynrecordset.RecordCount

解决方案 »

  1.   

    if dynrecordset.next then
      return dynrecordset.length
    endif
      

  2.   

    dim i as integer
    if not dynrecordset.eof or not dynrecordset.bof then
       i=dynrecordset.recordcount
    end if
      

  3.   

    ("select count(*) from 表 where name=...",dbopensnapshot)
      

  4.   

    Sub CountX()
        Dim dbs As Database, rst As Recordset
        ' 在您的计算机中修改此行使其正确指到 Northwind 的路径。    Set dbs = OpenDatabase("Northwind.mdb")    ' 对运费超过 $100 的订单,        ' 计算已送货到英国的订单笔数。    '     Set rst = dbs.OpenRecordset("SELECT" _        & " Count (ShipCountry)" _        & " AS [UK Orders] FROM Orders" _        & "WHERE ShipCountry = 'UK';")        ' populateRecordset。    rst.MoveLast        ' 调用 EnumFields 来打印记录集的内容。    '传递记录集对象和要求的字符宽度。    '     EnumFields rst, 25
        dbs.Close
    End Sub
      

  5.   

    to 风尘鸟:
        老兄,我从来都是这样用的,没有什么不妥啊,到是无论符合要求的记录数有多少,dynrecordset.recordcount的返回值都是1 为什么?
      

  6.   

    打开方式可能有问题
    试试sql=select * from 表 where name=..."
    dynrecordset.open sql,conn,1,3
      

  7.   

    你使用的是DAO
    使用 select count(*) from biao 试试
      

  8.   

    先movefirst再用recordcount属性。
      

  9.   

    很简单只要先将记录集movelast,再movefirst就能得到recordcount的值了