How can I find out how many records where returned from a query?
Printable View
How can I find out how many records where returned from a query?
try this:
CRecordset.MoveLast();
CRecordset.GetRecordCount();
oren.
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