Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Multiple Recordsets From a Stored Procedure


Message #1 by "SamK" <sjkirky@b...> on Wed, 18 Jul 2001 23:29:33 +0100
Folks,



Does anyone know how to collect and store multiple recordsets from a stored

procedure? I have tried the following code, and it does not work.



<%

    ..Standard DB Connection - not a problem...



    Dim rsRecordSet1

    Dim rsRecordSet2

    Dim rsSProcResults



    ...Declare as ADODB.Recordsets...



    rsSProcResults = objConnection.Execute "SP_STORED_PROCEDURE"



    Set rsRecordSet1 = rsSProcResults.Clone

    Set rsSProcResults = rsSProcResults.NextRecordset

    Set rsRecordSet2 = rsSProcResults.Clone

%>



Anyone out there got any notions of how to adapt, or complete scrap this

notion? Thanks a lot



SamK





Message #2 by "Ken Schaefer" <ken@a...> on Thu, 19 Jul 2001 09:57:08 +1000
What do you mean "no working"? Do you get an error? Do you get results?



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

----- Original Message -----

From: "SamK" <sjkirky@b...>

Newsgroups: asp_databases

To: "ASP Databases" <asp_databases@p...>

Sent: Thursday, July 19, 2001 8:29 AM

Subject: [asp_databases] Multiple Recordsets From a Stored Procedure





: Folks,

:

: Does anyone know how to collect and store multiple recordsets from a

stored

: procedure? I have tried the following code, and it does not work.

:

: <%

:     ..Standard DB Connection - not a problem...

:

:     Dim rsRecordSet1

:     Dim rsRecordSet2

:     Dim rsSProcResults

:

:     ...Declare as ADODB.Recordsets...

:

:     rsSProcResults = objConnection.Execute "SP_STORED_PROCEDURE"

:

:     Set rsRecordSet1 = rsSProcResults.Clone

:     Set rsSProcResults = rsSProcResults.NextRecordset

:     Set rsRecordSet2 = rsSProcResults.Clone

: %>

:

: Anyone out there got any notions of how to adapt, or complete scrap this

: notion? Thanks a lot

:

: SamK





Message #3 by "Sam Kirkpatrick" <sjkirky@b...> on Thu, 19 Jul 2001 12:07:48
Sorry - I suppose I should have expanded on that. I get various different 

errors, from the likes of "Object expected" to objects returned which 

don't seem to be recordsets to infinite loops.



I'm really struggling - and have tried various amendments to attempt to 

make this work.



Thanks



SamK



> What do you mean "no working"? Do you get an error? Do you get results?

> 

> Cheers

> Ken

> 

Message #4 by "Tomm Matthis" <matthis@b...> on Thu, 19 Jul 2001 08:28:19 -0400
I believe you're going to have to call the SProc with an ADO command 

object instead of a connection object.

Also, you don't need to use the .Clone method on the first recordset.



-- Tomm

> -----Original Message-----

> From: SamK [mailto:sjkirky@b...]

> Sent: Wednesday, July 18, 2001 6:30 PM

> To: ASP Databases

> Subject: [asp_databases] Multiple Recordsets From a Stored Procedure

>

>

> Folks,

>

> Does anyone know how to collect and store multiple recordsets

> from a stored

> procedure? I have tried the following code, and it does not work.

>

> <%

>     ..Standard DB Connection - not a problem...

>

>     Dim rsRecordSet1

>     Dim rsRecordSet2

>     Dim rsSProcResults

>

>     ...Declare as ADODB.Recordsets...

>

>     rsSProcResults =3D objConnection.Execute "SP_STORED_PROCEDURE"

>

>     Set rsRecordSet1 =3D rsSProcResults.Clone

>     Set rsSProcResults =3D rsSProcResults.NextRecordset

>     Set rsRecordSet2 =3D rsSProcResults.Clone

> %>

>

> Anyone out there got any notions of how to adapt, or complete scrap 

this

> notion? Thanks a lot

>

> SamK

>

>

>


  Return to Index