Hm, sieht eigentlich gut aus.
Fang die Exception mal ab:
::CoInitialize(NULL);
_ConnectionPtr pConn;
pConn.CreateInstance(__uuidof(Connection));
try {
pConn->Open(L"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=VCPPTestDB",L"",L"",adOpenUnspecified);
}
catch(_com_error &e) {
ErrorPtr pErr = NULL;
if( (pConn->Errors->Count) > 0) {
long nCount = pConn->Errors->Count;
for(long i = 0;i < nCount;i++) {
pErr = pConn->Errors->GetItem(i);
printf("\t Error number: %x\t%s", pErr->Number, pErr->Description);
}
}
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
printf("Error\n");
printf("\tCode = %08lx\n", e.Error());
printf("\tCode meaning = %s\n", e.ErrorMessage());
printf("\tSource = %s\n", (LPCSTR) bstrSource);
printf("\tDescription = %s\n", (LPCSTR) bstrDescription);
}[/CODE]