From: Paul S. Ganney on
I wrote a class to do this sort of thing in a simple way (obviously it
all depends on how often you may want to do it!)

It's here: http://www.Codeproject.com/KB/database/CountSet.aspx and
also demonstrates ways of tweaking CRecordset that you may want to
build on.

Paul.
From: Eddie Paz on
Here's some pseudo code:

CRecordset rs;
rs.Open(_T("select count(*) from some_table"));

CString strTmp;
rs.GetFieldValue((short)0, strTmp);

long nRecCount = _tstol(strTmp);

---
GetRecordCount() only gets you the number of records that have been fetched
so far and not a true count. I usually use this to determine if I got a any
records based on my criteria.

Hope this helps.

"Andreas Warning" <andy41(a)gmx.net> wrote in message
news:O5tXVgOpKHA.1548(a)TK2MSFTNGP04.phx.gbl...
> Hello,
>
> how can I find out how many records are in a SQL Table.
>
> I used MFC Recordsets
>
> Do you have an idea ?
>
> Thanks
> Andreas
>