Solved

How Do I Return Multiple Recordsets from SQL Stored Procedure in Access 2010

Posted on 2013-12-04
3
824 Views
Last Modified: 2013-12-04
I’ve created a pass-through query in Access which executes a stored procedure that searches for a string across all tables in my SQL database. The stored procedure on the SQL server runs as expected, returning multiple Recordsets that contain the value of my search string. However, when I double-click on the pass-through query in Access, in Datasheet View I see the results of only one Recordset.  Since it appears that Access is not designed to handle multiple result sets, then how do I use VBA in Access to accomplish this?
0
Comment
Question by:cartb4horse
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39696322
I don't think you'd see those results in the query window. You'd have to manage this through code, something like:

Dim rst As New ADODB.Recordset
rst.Connection = YourADOConnection
rst.OPen "EXEC YourSPName"

Dim rst1 As Variant
Dim rst2 As Variant

rst1 = rst.NextRecordset
rst2 = rst.NextRecordset
'/ and so on

This is aircode, from some stuff I did a loooong time ago ... hope it helps.
0
 
LVL 1

Author Comment

by:cartb4horse
ID: 39696802
I think this will work for me.  I also found this MS article that has a similar approach:  http://support.microsoft.com/kb/182290.
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39696806
I think that was for an ODBCdirect workspace - which is no longer supported in Access but still mentioned in the on-line help (look it up).

Thus, I believe, this is not possible with A2010+.

/gustav
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now