Get recordset from sql procedure

  • Thread starter Thread starter Abrm
  • Start date Start date
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
 
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
 
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!!!
 
Back
Top