老兄你的写法我没见过:
我一般这样定义
dim dynrecordset as new recordset
Dim ADOCnn As New ADODB.Connection
然后赢SQL语句打开记录机
看:dynrecordset.RecordCount
我一般这样定义
dim dynrecordset as new recordset
Dim ADOCnn As New ADODB.Connection
然后赢SQL语句打开记录机
看:dynrecordset.RecordCount
return dynrecordset.length
endif
if not dynrecordset.eof or not dynrecordset.bof then
i=dynrecordset.recordcount
end if
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
老兄,我从来都是这样用的,没有什么不妥啊,到是无论符合要求的记录数有多少,dynrecordset.recordcount的返回值都是1 为什么?
试试sql=select * from 表 where name=..."
dynrecordset.open sql,conn,1,3
使用 select count(*) from biao 试试