Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call the stored procedure in ADO or DAO??

Status
Not open for further replies.

qajussi

Programmer
Mar 22, 2004
236
US
Hi!

How do I call the stored procedure in sql server from the access report using ADO or DAO??

Say I have spGetAddress stored procedure.
How do i call this in the access using the ado or dao?

THanks.
 
You need to set up an ODBC connection to the server and then use Access's Pass Through queries.




G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Thanks guys.

So Pass through queries are stored procedures.
I already have been using the pass through query.

Can you still call the stored procedures on the sql server from the access??

 
Can I do this way??

create Query1 as a "SQL Pass Through query"
you have to specify the ODBC connection string, you do this through the properties of the query


in the code of a form or module you run this:

CurrentDb.QueryDefs!Query1.sql = "EXEC spName " DoCmd.OpenQuery "Query1"

NOTE: spName = the stored procedure you want to run


I don't really understand this syntax.
why do you have query1 and run another stored procedure??

Is it like doing subquery from the query??



 
So Pass through queries are stored procedures.


No, NO.

PassThrough queries provide you with a window to look at the Dynaset created by a StoreProcedure.

Access has PT queries, Access does not have SPs

G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top