Click to See Complete Forum and Search --> : How many Records returned


delbert Harry
April 29th, 1999, 04:46 PM
How can I find out how many records where returned from a query?

oren y
April 30th, 1999, 05:57 AM
try this:
CRecordset.MoveLast();
CRecordset.GetRecordCount();
oren.

lasslop
April 30th, 1999, 06:16 AM
it depends on the database

"intelligent" db like oracle:

recSet.MoveLast();
count = recSet.GetRecordCound();

"stupid" db like Access:
recSet.MoveFirst();
while (recSet.MoveNext())
{
//doNothing
}
count = recSet.GetRecordCound();

I don't know why, but you need to traverse through every record to get the real count.

ciao,

richard