Ole DB for OLAP - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Ole DB for OLAP

Tarek JabriTarek Jabri Posts: 7Member
I am trying to connect to MDP provider using
OLE DB For OLAP following these steps:
1-i'v got the List of providers..and choose one of them
2-i called ParseDisplayName() ,..the i called BindMoniker() method as written in the code below...
3-When i Call ppIDBInitialize->Initialize(); ..i got Access voilation exception
can any one help me please....
Here is the code:

ULONG chEaten = 0;
hr = pIParseDisplayName->ParseDisplayName(pIBindCtx,rgEnumInfo[i].wszParseName, &chEaten, &pIMoniker);
ppIDBInitialize=NULL;
hr = BindMoniker(pIMoniker, 0, IID_IUnknown,(void**)&ppIDBInitialize);

rgProps[0].dwPropertyID = DBPROP_INIT_LOCATION;
rgProps[0].vValue.vt = VT_BSTR;
rgProps[0].vValue.bstrVal = SysAllocString(L"server");

rgProps[1].dwPropertyID = DBPROP_INIT_DATASOURCE;
rgProps[1].vValue.vt = VT_BSTR;
rgProps[1].vValue.bstrVal = SysAllocString(L"FoodMart 2000");

rgProps[2].dwPropertyID = DBPROP_AUTH_INTEGRATED;
rgProps[2].vValue.vt = VT_BSTR;
rgProps[2].vValue.bstrVal = SysAllocString(L"SSPI");

// Create the structure containing the properties.
DBPROPSET PropSet;
PropSet.rgProperties = rgProps;
PropSet.cProperties = 3;
PropSet.guidPropertySet = DBPROPSET_DBINIT;

IDBProperties *pIDBProperties=NULL;

// create properties pointer
hr=ppIDBInitialize->QueryInterface(IID_IDBProperties,(void**)&pIDBProperties);

// Set properties
hr=pIDBProperties->SetProperties(1, &PropSet);

// Initialize the data source object.
hr = ppIDBInitialize->Initialize(); // Access voilation exception

Sign In or Register to comment.