-
simple MSDN code failed.
Hello all.
I'm trying simple code from MSDN. Somehow it failed. WHAT I'M DOING WRONG ?
I create c:\test.mdb with one table (two sipmple fields) by MS-Access. No
records.
Simple console application generate an exception inside Open() call.
I changed #import line because it didn't compiled.
#include
#import "C:\Program Files\Common Files\Microsoft
Shared\Repostry\repodbc.dll" rename("repodbc", "rtim") named_guids
using namespace RepositoryTypeLib;
void FunctionCalledFromMain(void)
{
CComPtr pRep;
CComPtr pRootRO;
CoInitialize(NULL);
HRESULT h1 = pRep.CoCreateInstance(CLSID_Repository, NULL);
pRootRO = pRep->Open("c:\\test.mdb", "", "", 0);
// HRESULT _hr = raw_Open(Connect, User, Password, fFlags, &_result);
// _hr == 0x80041035 and IRepository::Open throw exception
// some code here
}
thx and regards