Stored Procedure

dmcgimpsey

Active Member
Joined
Mar 30, 2004
Messages
268
Hi There

I am trying to create a stored procedure in Access that accepts up to three parameters.

Is there an example anywhere that will do what I wish? I would like to call the SP from Excel. I am not having much luck, there are too many examples out there, and I haven't been able to get one to work.

By the way, where do I execute the code? In the VB window?

Thanks in advance, I am under tight deadline, and appreciate any help. I am managing to stay ahead of the game by doing things manually, and having one sql interface for each Excel Workbook, but that will require over 300 workbooks, so I need an alternative.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Access doesn't have "stored procedures" from the SQL Server type of definition. You can, on the other hand, create VBA Procedures that accept variables. (fixed, optional or even variable # of them)

Code:
Sub AcceptVariables(varName As varType)

End Sub

varType has to be one of the standard ones.

Here's a link to execute xls macros from Access vba
http://www.mvps.org/access/modules/mdl0007.htm

Peek here for your actual question Excel running Access
http://www.mrexcel.com/board2/viewtopic.php?t=82219&highlight=run+access+macro

Although they didn't answer, and I've never tried to run Access VBA from Excel...I'm suspicios that the command is:

DoCmd.RunCode codemodulename
 
Upvote 0
I managed to get a sample of code that worked.

Now I just have to figure out how to pass the parameters from a VB call from Excel.

Have a nice day.
 
Upvote 0

Forum statistics

Threads
1,221,672
Messages
6,161,199
Members
451,688
Latest member
Gregs44132

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top