How can I read multiple ADO recordsets into Excel using VBA

Posted on 2011-05-09
Last Modified: 2013-11-05
I have a stored procedure in an MS SQL Server 2008 R2 database that returns multiple recordsets which works very well from my .NET application. My customer nows wants to drop the same data in MS Excel. Is there a similar object in VBA as the .NET dataset that can read muliple recorsets?
Question by:Vincent_Monaghan
    LVL 85

    Accepted Solution

    You can return multiple recordsets into an ADO recordset object in VBA and then use the Recordset's NextRecordset method to move from one to the next.

    Author Comment

    Thanks Rorya

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
    This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
    The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
    This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

    734 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