Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Counting Query Rows in Access


Message #1 by "Binu" <beanz75@a...> on Fri, 22 Mar 2002 01:40:48
Hi-

How can i count the number of records in a query using ASP.  I am able to 
use the the RecordCount Property of the RecordSet object to count the 
number of records in an Access table, but it does not seem to work for a 
query.  Is there a certain way to count the number of rows in a query?

Thanks,

Binu
Message #2 by brian.skelton@b... on Fri, 22 Mar 2002 10:14:06
Hi Binu

Can you run a second query purely to count the records?

ie if your query is:

SELECT tbl.fldUID FROM tbl

Your second query would be:

SELECT COUNT(tbl.fldUID) FROM tbl

Alternatively, try using the MoveLast method on your recordset and then 
looking at the recordcount. This may give an accurate count.

Brian

> Hi-

> How can i count the number of records in a query using ASP.  I am able 
to 
u> se the the RecordCount Property of the RecordSet object to count the 
n> umber of records in an Access table, but it does not seem to work for a 
q> uery.  Is there a certain way to count the number of rows in a query?

> Thanks,

> Binu

  Return to Index