Pass a parameter to a stored procedure from ms access

S

SAC

Access 2000 and SQL 2000

How do I pass a parameter to a stored procedure from ms access?
 
O

Ofer Cohen

Using the PassThrough Query it just as using the SQL analyser in the SQL
Server.

So you can use

Exec SPName 23,'2/2/2007','MyStr'

If you want to change the parameters from Access every time you run it,
youll need to change it using code and then run the query

MySQL = "Exec SPName 23,'2/2/2007','MyStr'"
Application.CurrentDb.QueryDefs("QueryName").SQL = MySQL
 
S

SAC

Thanks!
Ofer Cohen said:
Using the PassThrough Query it just as using the SQL analyser in the SQL
Server.

So you can use

Exec SPName 23,'2/2/2007','MyStr'

If you want to change the parameters from Access every time you run it,
youll need to change it using code and then run the query

MySQL = "Exec SPName 23,'2/2/2007','MyStr'"
Application.CurrentDb.QueryDefs("QueryName").SQL = MySQL
 

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