How do I get the data from my Access-Database in my ComboBox? I get the error "Debug Assertion Failure" all the time.
Student Flanders Language Valley
Programmer
Printable View
How do I get the data from my Access-Database in my ComboBox? I get the error "Debug Assertion Failure" all the time.
Student Flanders Language Valley
Programmer
I suppose that you have a member variable of type CMyDaoRecordSet in your view class named m_Set. Now in the InitialUpdate() do the following:
try
{
if(! m_Set.IsOpen()) m_Set.Open();
}
catch(CDaoException* e)
{
e->Delete();
return 0;
}
CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO);
if(! m_Set.IsBOF())
{
while(! m_Set.IsEOF())
{
pComboBox->AddString(m_Set.m_NameToAdd);
m_Set.MoveNext();
}
}
If this doesnot help send me your code and I will fix it.
Regards,
ric