?
Solved

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

Posted on 2013-12-04
3
Medium Priority
?
1,035 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:Darlyne Pitt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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:Darlyne Pitt
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 51

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

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

765 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