CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    Jerusalem, Israel
    Posts
    251

    Q:Showing list of items of large database.

    Hello!

    I'm writing a database application and I want to show list of items from the DAO recordset(in ListBox and in List Control).

    I do it with code like this (example for list box):

    void FillListBox(CMyRecordset *prsData, CListBox *plbBox)
    {
    ASSERT(psData->IsOpen())
    prsData->MoveFirst();
    while(!prsData->IsEOF())
    {
    plbBox->AddString(prsData->m_MyString);
    prsData->MoveNext();
    }
    }




    It works fine with small databases, but when number of records in database is about 100000 or more, it works very slow(about 5 - 10 minutes).
    All that I need is to display the list of items and allow user to choose some of them. How can I do this without loosing performance?

    Thank you in advance,

    Jack Shainsky
    Jerusalem, Israel.
    [email protected]

  2. #2
    Join Date
    May 1999
    Posts
    17

    Re: Q:Showing list of items of large database.

    Try using a ListCtrl in virtual mode - there is an article (or sample) in MSDN

    Howard.



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