[AccessD] Stored procedures from Access

jwcolby jwcolby at colbyconsulting.com
Thu Jan 22 10:59:29 CST 2009


OK, I have built my first pass through query, which runs 
just fine.

Basically I am trying to run stored procedures in SQL which 
have parameters.

I built the pass through query as a simple

"exec MyProcName, Param1, Param2"

Where param1 and param2 are hard coded.  I do not see a way 
to place parameters in a collection like you can do with 
regular queries.  Did I miss something there?

Now, I think it was Charlotte (I deleted the email after 
copying the code) that provided a CallADOStoredProc, which I 
am trying to use.  However I am getting an "odbc call 
failed" error, which I am pretty certain is because it uses 
the standard currentproject.connection.  That connection 
does not reference the server or the database, so how can it 
know where to send the odbc call?

Questions:

1) Is the parameter collection that is being filled in 
CallADOStoredProc replace the hard coded parameters in my 
pass through query?  I.e. can I just remove the hard coded 
parameters and place them in the call to CallADOStoredProc?

2) Is CallADOStoredProc looking for a local pass through 
query at all, or is it looking for the name of a stopred 
procedure out in SQL Server?

3) Do I need to find a "standard" connection string which 
will reference the SQL Server?

I am now using tons of Stored Procedures out in SQL Server 
but I have absolutely zero experience causing them to 
execute from Access.  I need some very basic instructions on 
how to do this.  I have found things on the internet but 
they all seem to start with "you know how to do this and 
here are some tricks" rather than "since you know nothing, 
here is what you are doing and why".

Can anyone here provide a "since you know nothing" approach?

TIA,

-- 
John W. Colby
www.ColbyConsulting.com



More information about the AccessD mailing list