Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Can't read multi-field resultsets in ADO with C++
DO a Search on Codeguru.com , I have seen a similar Problem a while a
ago , dont remember the Solution right now.
Faheem Rao
seekingsolns_at_yahoo.com (seekingsolns) wrote in message news:<ab3e23fe.0110231154.26033f9b_at_posting.google.com>...
> I am trying to call an stored procedure from ADO that has several
> resultset outputs. My problem is trying to read from the second field
> of the output resultset. The "NextRecordset" method does not give me
> access as I would expect. I have seen many examples in VB but cannot
> find any C++ code examples.
>
> The stored procedure looks like this:
>
> PROCEDURE multirec
> (onessn IN NUMBER,
> abc OUT NUMBER,
> tableabc OUT tssn,
> tablessn OUT tssn,
> ssn OUT NUMBER)
> IS
> BEGIN
> ssn := 5 * onessn;
> tableabc(1) := 10 * onessn;
> tablessn(1) := 20 * onessn;
> abc := 2 * onessn;
> END;
>
> Using C++, I use the ADO command object and set up the execute command
> text. Question marks in the bsExecuteString denote scalar parameters:
>
> _bstr_t bsExecuteString = "{call mixparam.multirec(?,?,{resultset
> 100, tableabc},{resultset 100,tablessn},?)}";
> comm->put_ActiveConnection(_variant_t((IDispatch
> *)m_connection,true));
> comm->put_CommandText(bsExecuteString);
> comm->put_CommandType(adCmdText);
>
> I then append all the scalar parameters to the command object and
> execute the command object with the "open method" like this:
>
> RecSetPtr->Open(_variant_t((IDispatch *)comm,true),vtEmpty,
> adOpenStatic, adLockReadOnly, 0);
>
> I can then read all the scalar output parameters but only the first
> field of the resultset. That is, I can only read the records in
> "tableabc" and not "tablessn":
>
> pFP = RecSetPtr->Fields->GetItem(& index);
> vRes.bsName = pFP->GetName(); // Gives "tableabc"
> vRes.cvValue = pFP->GetValue(); // Gives the correct value
>
> How do I get to the second field of the resultset (ie "tablessn")???
> The "NextRecordset" method just gives this error:
>
> Code = 800a0cb3
> Code meaning = Unknown error 0x800A0CB3
> Source = ADODB.Recordset
> Description = Object or provider is not capable of performing
> requested operation.
>
> Thanks in advance.
Received on Wed Oct 24 2001 - 02:16:07 CDT
![]() |
![]() |