Re: Multiple Recordset from a Stored Procedure



I know zip about Oracle and zip + 1 / infinity about multiple
recordsets but I am so interested that I couldn't resist the search
myself:

I came upon:
http://www.oracle.com/technology/sample_code/tech/windows/ole_db/oledb8/index.html
Returning multiple recordsets from a stored procedure[13-Mar-2003]
This sample shows how to return multiple recordsets from database
stored procedure using ActiveX Data Objects (ADO) with VB
Download Now (ZIP, 103KB)

Also I note that ADO help suggests that we can roll our own multiple
recordset returning command as:
"If you open a Recordset object based on a compound command statement
(for example, "SELECT * FROM table1;SELECT * FROM table2") using the
Execute method on a Command or the Open method on a Recordset, ADO
executes only the first command and returns the results to recordset.
To access the results of subsequent commands in the statement, call the
NextRecordset method."

And I experimented with MS-SQL as follows:

Dim r As ADODB.Recordset
Dim r2 As ADODB.Recordset
Set r = CurrentProject.Connection.Execute( _
"SET NOCOUNT ON " _
& "SELECT * FROM FFDBATransactions " _
& "COMPUTE AVG(TotalAmount)")
Set r2 = r.NextRecordset
Debug.Print r.GetString(adClipString, 1, vbTab, vbNewLine)
Debug.Print r2.GetString(adClipString, 1, vbTab, vbNewLine)
Set r = Nothing
which gives:

1 2004-01-01 Carryover from 2003 7290.07 17 1 11

591.5508

And I'm going to ask a question about multiple recordsets and no count
in a separate thread.

.



Relevant Pages

  • Re: "Insert Into tbl1 Values(" & dynamicParams & ")" ?
    ... I am familiar with Command ... that I am using com ADO in a Non ... Thinking outloud here I am thinking ... Just open a recordset against the new table and the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ADO Performance question
    ... Currently I am combining all my insert queries and passing as command text ... There is one more way by opening a recordset and call AddNew on recordset ... multiple times and then batch update. ... It makes a difference as the SQL Server Provider allows multiple commands ...
    (microsoft.public.data.ado)
  • Re: Using Recordset.State Property
    ... In this situation, you do not have multiple instances, there is only one ... If the recordset is being used for two or more distinct purposes, ... I do not have another declaration, ... >> Worked fine for me when I declared the rs as Public in a Standard Module ...
    (microsoft.public.access.formscoding)
  • Re: Updating a field on a continous form
    ... the multiple copies of the form that you see are really multiple ... Although the diplayed recordset data ... > I have a problem whereby I have a continuous form ... If I set this field Unboundfield = ...
    (microsoft.public.access.forms)
  • Re: Datagrid multiple row selections
    ... > It is possible to press Ctrl and make multiple selections of separate rows ... ' First you'll need to make a clone of the recordset that's bound to the ... the bookmarks will not be ...
    (microsoft.public.vb.database.ado)