Count record aside from Recordcount
How can I have record count without using RecordCount function. Is there a way like
Select Count(*) from Tablename
If there is..how can I code this?
starting with
Dim RS As ADODB.Recordset
Set RS = new ADODB.Recordset
RS.Open ....
cecile
The more u read, the more u do not know
Re: Count record aside from Recordcount
Dim RS As ADODB.Recordset
Set RS = new ADODB.Recordset
RS.Open "SELECT COUNT(*) as RecordCount FROM TableName",cnYourConnection, adOpenKeyset, adLockOptimistic, adCmdText
debug.print RS!RecordCount
rs.close
set rs = nothing
David Paulson
Re: Count record aside from Recordcount
If you want to use the "select count(*) from Tablename" method, just set a variable to the result like this:
lngCount = RS.Fields(0)