By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,203 Members | 1,401 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,203 IT Pros & Developers. It's quick & easy.

Using MS-SQL SP with parameter from MS-Access

P: 1
I have a MS-Access frontend with a MS-SQL backend db. My problem is that I'm trying to use a stored procedure from my MS-Access, but I can find out how to call it.

I will use an input field on my access form as parameter input to the SP I'm calling in SQL.

My Access is a MDB database, and I understand that I must use VBA, but I just cant get it working.

Hope someone can help :-)
Oct 23 '06 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
Firstly you need to create a pass thru sql query and save it as "MyQuery"

Then use the following:

Expand|Select|Wrap|Line Numbers
  1.  
  2. dim db as database
  3. dim q as querydef
  4. set db=currentdb()
  5. set q=db.querydefs("MyQuery") 
  6. q.sql="EXECUTE your_sp" & <Your Parameters>
  7.  
  8.  



I have a MS-Access frontend with a MS-SQL backend db. My problem is that I'm trying to use a stored procedure from my MS-Access, but I can find out how to call it.

I will use an input field on my access form as parameter input to the SP I'm calling in SQL.

My Access is a MDB database, and I understand that I must use VBA, but I just cant get it working.

Hope someone can help :-)
Oct 23 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.