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



Ok, I tried this way but now instead of getting 3 rows returned (which is how
many rows there are in my table), I now get 14549040 rows returned? Hmm, any
ideas?

Thanks,

David

> Consider something like this (which pushes most of the work to the database
> server and fetches one row with one field):
>
> CRecordset rs(&db);
> rs.Open(CRecordset::ForwardOnly,"Select count(*) from
> Records",CRecordset::ReadOnly);
> CDBVariant vtval;
> rs.GetFieldValue((short)0,vtval);
> int rowcount = vtval.m_lVal;
> rs.Close();
>
>
> regards
> Roy Fine
>
>
>
.



Relevant Pages

  • Re: Using Enterprise Manager to view a single Database
    ... Basically the problem I have is that the 'Database' container in EM contains ... >> I've been working with SQL server for a few years now, ... > database list in SQL EM, ... SQL EM only fetches enough rows to populate the screen. ...
    (microsoft.public.sqlserver.clients)
  • Re: Using Enterprise Manager to view a single Database
    ... > I've been working with SQL server for a few years now, ... database list in SQL EM, ... SQL EM only fetches enough rows to populate the screen. ...
    (microsoft.public.sqlserver.clients)
  • Create SharePoint Portal failed.
    ... One mentioned ensuring that SQL Server uses a case ... 13:55:40 Service database server is 'USDC-JOHRIV'. ... Update dbo.propertylist set DisplayName = N'Last name' ...
    (microsoft.public.sharepoint.portalserver)
  • Re: ADO Connection Timeout
    ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Web Developers - Happy Hearts And HDTV! - Lockergnome
    ... Certificate on your MSIIS Web server. ... getting data from a database is only half the problem. ... Zend recently started a series about building rock solid code in PHP. ... which provides bulk database conversion. ...
    (freebsd-questions)

Loading