Ole DB for OLAP
-
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