|
-
July 5th, 1999, 04:39 AM
#1
CFormView-ComboBox
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
-
July 5th, 1999, 06:25 AM
#2
Re: CFormView-ComboBox
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|