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]
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.