Click here to Skip to main content
15,890,336 members
Home / Discussions / Database
   

Database

 
GeneralRe: What kind of Errors the SELECT statement can raise?? Pin
_J_29-Mar-05 1:57
_J_29-Mar-05 1:57 
GeneralRe: What kind of Errors the SELECT statement can raise?? Pin
Colin Angus Mackay29-Mar-05 11:01
Colin Angus Mackay29-Mar-05 11:01 
GeneralRe: What kind of Errors the SELECT statement can raise?? Pin
_J_29-Mar-05 11:07
_J_29-Mar-05 11:07 
AnswerRe: What kind of Errors the SELECT statement can raise?? Pin
Andy Brummer29-Mar-05 11:22
sitebuilderAndy Brummer29-Mar-05 11:22 
GeneralIdeas to Update DATA received from the client Pin
_J_28-Mar-05 6:38
_J_28-Mar-05 6:38 
GeneralRe: Ideas to Update DATA received from the client Pin
Edbert P28-Mar-05 20:06
Edbert P28-Mar-05 20:06 
GeneralRe: Ideas to Update DATA received from the client Pin
_J_28-Mar-05 21:27
_J_28-Mar-05 21:27 
GeneralMSDataShape Error Pin
gUrM33T28-Mar-05 4:32
gUrM33T28-Mar-05 4:32 
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: 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

GeneralQuestion about from syntax Pin
Esmo200028-Mar-05 4:19
Esmo200028-Mar-05 4:19 
GeneralRe: Question about from syntax Pin
Jeff Martin28-Mar-05 7:28
Jeff Martin28-Mar-05 7:28 
GeneralRe: Question about from syntax Pin
Esmo200028-Mar-05 7:41
Esmo200028-Mar-05 7:41 
GeneralDatasets/Updating Pin
Nuhn28-Mar-05 3:16
Nuhn28-Mar-05 3:16 
GeneralRe: Datasets/Updating Pin
Suman Singh29-Mar-05 11:04
professionalSuman Singh29-Mar-05 11:04 
GeneralRe: Datasets/Updating Pin
Nuhn7-Apr-05 4:56
Nuhn7-Apr-05 4:56 
Questionhow to get name of all tables in msaccess database Pin
sumit2127-Mar-05 7:07
sumit2127-Mar-05 7:07 
AnswerRe: how to get name of all tables in msaccess database Pin
rwestgraham28-Mar-05 18:25
rwestgraham28-Mar-05 18:25 
GeneralDataRelation question Pin
IlanTal26-Mar-05 21:36
IlanTal26-Mar-05 21:36 
GeneralRe: DataRelation question Pin
Scott Serl28-Mar-05 10:06
Scott Serl28-Mar-05 10:06 
GeneralRe: DataRelation question Pin
IlanTal28-Mar-05 18:38
IlanTal28-Mar-05 18:38 
GeneralRe: DataRelation question Pin
Scott Serl29-Mar-05 6:44
Scott Serl29-Mar-05 6:44 
GeneralRe: DataRelation question Pin
IlanTal29-Mar-05 7:10
IlanTal29-Mar-05 7:10 
GeneralQuestion about SELECT Pin
_J_26-Mar-05 5:57
_J_26-Mar-05 5:57 
GeneralRe: Question about SELECT Pin
turbochimp26-Mar-05 11:35
turbochimp26-Mar-05 11:35 
GeneralRe: Question about SELECT Pin
Colin Angus Mackay29-Mar-05 1:03
Colin Angus Mackay29-Mar-05 1:03 
GeneralRe: Question about SELECT Pin
_J_29-Mar-05 1:41
_J_29-Mar-05 1:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.