Been searching the whole morning now, still can't find the problem?
I read somewhere on the forum that I can replace
m_strNaam = (char*) (_bstr_t) m_pRS->Fields->GetItem("Naam")->Value ;
with
m_strNaam = (char *) (_bstr_t) m_pRS->GetCollect("Naam") ;
???
Maybe there is something wrong with my initialize code?
::CoInitialize(NULL) ; m_strConnection = _T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = ..//Database.mdb") ; m_strCmdText = _T("select * from personen") ; m_pRS = NULL ; m_piAdoRecordBinding = NULL ; m_pRS.CreateInstance(__uuidof(Recordset)) ; try { m_pRS->Open((LPCTSTR)m_strCmdText, (LPCTSTR)m_strConnection, adOpenKeyset, adLockOptimistic, adCmdUnknown) ; } catch(_com_error &e) { AfxMessageBox(e.Description()) ; } if (SUCCEEDED(m_pRS->QueryInterface(__uuidof(IADORecordBinding), (LPVOID*) &m_piAdoRecordBinding))) { m_piAdoRecordBinding->BindToRecordset(&m_rsADORecSet) ; return S_OK ; } else { MessageBox(NULL, "Fout bij het aanspreken van de database!", "Fout!", MB_OK) ; return S_FALSE ; }
Hope some1 can help me out