Jack Shainsky
May 23rd, 1999, 07:19 AM
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.
jack.shainsky@usa.net
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.
jack.shainsky@usa.net