Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Ole DB for OLAP

Ole DB for OLAP

Scheduled Pinned Locked Moved C / C++ / MFC
databasecomsysadminhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tarek Jabri
    wrote on last edited by
    #1

    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

    Steve EcholsS 1 Reply Last reply
    0
    • T Tarek Jabri

      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

      Steve EcholsS Offline
      Steve EcholsS Offline
      Steve Echols
      wrote on last edited by
      #2

      Check the result (hr) of: hr = BindMoniker(pIMoniker, 0, IID_IUnknown,(void**)&ppIDBInitialize); I'm guessing ppIDBInitialize is still NULL. Put a breakpoint on that line in debug mode and check it. (I know little about the OLE DB or OLAP, so I don't know why it's failing).


      - S 50 cups of coffee and you know it's on!

      • S
        50 cups of coffee and you know it's on!
        Code, follow, or get out of the way.
      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups