Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I determine row count using MS Access.

Status
Not open for further replies.

martindavey

Programmer
Jan 2, 2000
122
GB
I have a CRecordset object.

CString strSQL="select * from [myTable]";
OldRS.Open(CRecordset::dynaset,strSQL,CRecordset::readOnly);

I now want to store the number of rows in an integer.

Any ideas?
 
In principal you can use GetRecordCount(), but only after reading through the records to the end (not with MoveLast()). The most efficient way of counting records via SQL is generally Select Count(*) From ... :) Hope that this helped! ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top