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. Database & SysAdmin
  3. Database
  4. MSDataShape Error

MSDataShape Error

Scheduled Pinned Locked Moved Database
c++helphtmlcom
1 Posts 1 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.
  • G Offline
    G Offline
    gUrM33T
    wrote on last edited by
    #1

    SHAPE {EXEC sp_S_Events} APPEND ({SELECT * FROM attendees WHERE event_id=?} RELATE event_id TO PARAMETER 0) AS rsAttendees From a method (namely, GetEvents) of my COM+ business layer component (written in Visual C++ 6.0 SP5), I am issuing the statement given above but it fails with an error saying: Error 0x80004005: The data provider or other service returned an E_FAIL status. However, the same statement works perfectly fine when executed from within a program of Visual Basic. A small portion of code from my COM+ component is given below:

    STDMETHODIMP CBizLayer::GetEvents(/*[in]*/ long EventID, /*[out, retval]*/ VARIANT *pDataset) {
    _ConnectionPtr spConn;
    _RecordsetPtr spDataset;
    try {
    .
    . // instantiate an ado connection and an recordset object
    .
    spConn->Provider = L"MSDataShape";
    spConn->Open(szConnect, _bstr_t(), _bstr_t(), -1);

    spDataset->PutRefActiveConnection(spConn);
    spDataset->PutCursorLocation(adUseClient);
    spRS->Open(szShapeCmd, vtMissing, adOpenForwardOnly, adLockReadOnly, adCmdText);
    spRS->PutRefActiveConnection(NULL);

    ::VariantClear(pDataset);
    V_VT(pDataset) = VT_DISPATCH;
    V_DISPATCH(pDataset) = (IDispatch*)(spDataset.Detach());

    m_spObjectContext->SetComplete();
    _hr = S_OK;
    }
    catch(const _com_error &ex) {
    [...]
    }
    catch(...) {
    [...]
    }

    I've tried to debug my component and I found out that the call to CBizLayer::GetEvents() method completes without any error (i.e. with an HRESULT of S_OK), but in the client application, I still receive this error :wtf: :wtf:. Why? What could be the reason? I am totally confused! Please help! Gurmeet


    BTW, can Google help me search my lost pajamas?

    My Articles: HTML Reader C++ Class Library, Numeric Edit Control

    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