Get recordset from sql procedure

A

Abrm

Hello,
we use access 2003, with SQL 2005.
In SQL2005 we have a database with a stored procedure.

I would like to run the stored procedure from Access(VBA) and put the result
of the stored procedure in an access table?

Anyone an idea?

Abrm
 
T

Tom van Stiphout

On Wed, 17 Dec 2008 04:54:15 -0800, Abrm

That would likely be a 2-step process: first get the results in an
ADODB.Recordset object, then copy the data to your Access table.

-Tom.
Microsoft Access MVP
 
A

Albert D. Kallal

You don't mention if it is an existing access table.

Here what you do:

Simply build a pass-though query with your call to the stored procedure.

It will look like:

Exec MyStroreProcNameGoesHere.

Now, save your pass-though query, and see if it works (just click on that
pass-though query).

Now, just build a append query based on the above pass-though

Then, in vba you then go:

currentdb.execute "name of appendquery"

So, you can do this with one line of code!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top