CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Posts
    92

    How many Records returned

    How can I find out how many records where returned from a query?


  2. #2
    Join Date
    May 1999
    Posts
    28

    Re: How many Records returned

    try this:
    CRecordset.MoveLast();
    CRecordset.GetRecordCount();
    oren.


  3. #3
    Join Date
    Apr 1999
    Posts
    1

    Re: How many Records returned

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured