Column BookID doesn't exist.
HI friends
i am again here with my problem.I have written a code which is
compiled without error,But when i want to debug it ,it shows the error
Column "BookID" doesn't exist.
I dont know why,
Becoz in my Databank there is Column BookID.
It is my code:
void CBookInformationView::DoDataExchange(CDataExchange* pDX)
{
CRecordView::DoDataExchange(pDX);
// you can insert DDX_Field* functions here to 'connect' your
controls to the database fields, ex.
DDX_FieldText(pDX, IDC_TITLE, m_pSet->m_BookTitle, m_pSet);
DDX_FieldText(pDX, IDC_CATEGORY, m_pSet->m_Category, m_pSet);
DDX_FieldText(pDX, IDC_RATING, m_pSet->m_Rating, m_pSet);
DDX_FieldText(pDX, IDC_NOTES, m_pSet->m_Notes, m_pSet);
// DDX_FieldCheck(pDX, IDC_MYCHECKBOX, m_pSet->m_bColumn2, m_pSet);
// See MSDN and ODBC samples for more information
DDX_Control(pDX, IDC_Author, m_Author_control);
UpdateAuthor(m_pSet->m_BookID);
}
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
bool CBookInformationView::UpdateAuthor(int id)
{
CAuthorRecordSet ars;
CBookAuthorRecordSet bars;
CString bookauthorSQL;
CString authorSQL;
CString display;
int pos;
m_Author_control.ResetContent();
bookauthorSQL.Format(_T("BookID=%d"),id);
bars.m_strFilter = bookauthorSQL;
bars.Open();
while (!bars.IsEOF())
{
authorSQL.Format (_T("AuthorID=%d"),bars.m_AuthorID);
ars.m_strFilter= authorSQL;
if ( ars.IsOpen())
ars.Requery();
else
ars.Open();
display = ars.m_AuthorName;
pos = m_Author_control.AddString(display);
bars.MoveNext();
}
return true;
}
i am very thankful to u all