Hi
I am sorry, but what I have used does not return a recordset. But what I
can think logically is that u can use:
set rs = conn.Execute "sp_doit(3)"
and it may return a recordset, but it also depends on what is that u r doing
in ur SP.
Shreekar
----- Original Message -----
From: "Cremieux, Judith K." <Judith.Cremieux@i...>
To: "professional vb" <pro_vb@p...>
Sent: Monday, October 22, 2001 6:24 PM
Subject: [pro_vb] Re: Oracle Stored Procs
> Shreekar,
> Do you have the syntax for executing an Oracle stored proc and returning a
recordset by setting
> cmdStoredProc.CommandType = adCmdStoredProc ?
> For returning a recordset we end up saying (as in the code below)
> cmdStoredProc.CommandType = adCmdText
> which kind of defeats half the purpose of a stored proc
>
> Set cmdStoredProc = New adodb.Command
>
> With cmdStoredProc
> Set .ActiveConnection = mConn 'previously opened
> .CommandText = "select 8 from some_tbl"
> .CommandType = adCmdText
> End With
>
> Set rs = New adodb.Recordset
> With rs
> .CursorLocation = adUseClient
> .CursorType = adOpenStatic
> .LockType = adLockReadOnly
> Set .Source = cmdStoredProc
> .Open
> End With
>
> For returning other data we use the Execute method successfully.
> i.e.
> With cmdStoredProc
> Set .ActiveConnection = mConn
> .CommandText = sCommandText
> .CommandType = adCmdStoredProc
> ' append inout parms
> ' now add the output parm
> .Parameters.Append .CreateParameter("outStatus", adInteger,
adParamOutput)
> .Execute
>
> End With
>
> > -----Original Message-----
> > From: Shreekar Joshi - Yahoo [SMTP:joshishreekar@y...]
> > Sent: Friday, October 19, 2001 11:44 PM
> > To: professional vb
> > Subject: [pro_vb] Re: Oracle Stored Procs
> >
> > Hi
> >
> > The same way u execute the stored procedures on Oracle prompt. There is
a
> > but to it :
> > On Oracle prompt:
> > exec sp_doit(3)
> > In VB:
> > Conn.Execute "sp_doit(" & id & ")"
> > where id = 3
> >
> > This is for stored procedures, I have used it successfully, but for
> > functions, there might be some other idea.
> >
> > Shreekar
> > ----- Original Message -----
> > From: "Saleem Qamar" <saleem.qamar@v...>
> > To: "professional vb" <pro_vb@p...>
> > Sent: Friday, October 19, 2001 7:03 PM
> > Subject: [pro_vb] Re: Oracle Stored Procs
> >
> >
> > > how,
> > >
> > > I would appreciate some code, please
> > >
> > > thanks
> > >
> > > Sal
> > >
> > > -----Original Message-----
> > > From: Shreekar Joshi - Yahoo [mailto:joshishreekar@y...]
> > > Sent: Thursday, October 18, 2001 11:35 PM
> > > To: professional vb
> > > Subject: [pro_vb] Re: Oracle Stored Procs
> > >
> > >
> > > Hi
> > >
> > > yes, u can do it the same way for Oracle
> > >
> > > Shreekar
> > > ----- Original Message -----
> > > From: "Saleem Qamar" <saleem.qamar@v...>
> > > To: "professional vb" <pro_vb@p...>
> > > Sent: Thursday, October 18, 2001 8:13 PM
> > > Subject: [pro_vb] Oracle Stored Procs
> > >
> > >
> > > > I need to execute Oracle stored procs from VB.
> > > > I don't want to use CreateParam....
> > > >
> > > > In MSSQL Server I can just use
> > > >
> > > > objRst.open "exec my_sp",Conn
> > > >
> > > > How can I do this for Oracle Stored Procs
> > > >
> > > > Thanks
> > > >
> > > > Sal