Prev: Dll has no DllMain or CWinApp?
Next: Problems with garbage characters in Chinese Win7 under VS2008.
From: Paul S. Ganney on 8 Feb 2010 07:03 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 9 Feb 2010 03:58 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 >
First
|
Prev
|
Pages: 1 2 3 Prev: Dll has no DllMain or CWinApp? Next: Problems with garbage characters in Chinese Win7 under VS2008. |