Re: CDatabase CRecordset - How to get the number of rows?



Hi,

Thanks for both your answers. I've changed my code a bit to this -

CRecordset rs(&db);
rs.Open(CRecordset::forwardOnly,_T( "SELECT * FROM Records" ) );

int count = 0;
while (!rs.IsEOF())
{
count += 1;
rs.MoveNext();
}

I've now dropped the COUNT (*) and have used just * in the SQL Statement. It
seems to be working a little better but i cant fully check it as I'm on my
home computer now. Interestingly, if I use the MoveLast() function I get a
runtime Debug Assertion failure?

Well, thanks once again for your help and views. I'll post any outcomes I
make,

Best,
David
.



Relevant Pages