Discussion Locked

Run a Stored Proc from Access 2000

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Wondering if it is a possible to use 'exec' with a stored procedure from Access 2000 (via Sybase)? I have tried but seems that it is getting nowhere or failed to connect. If anyone have that codes that would help me out -- that would be great! Thanks.

3 replies

by bob sellman

I've been doing this using Access 97 and SQL Server, but it should work the same way (or similar) using Access 2000 and Sybase, since you are still using an ODBC connection.

Create a pass through query in Access, set up with the correct connection information to connect to the Sybase ODBC database. The "SQL text" of the pass through query should actually be the code required to properly execute the procedure in Sybase. For example, in SQL Server it might be:

EXEC {ProcedureName} Var1={value1}, Var2={value2}

If you need to execute a procedure where you will pass different variables at different time, just use some standard name you define for the query (example: MyExecQuery) and create the query in VBA code where you build the SQL text with the proper values, etc. (since you can't refer to Access controls in the pass through query since it is executed without knowledge of the Access front end).

This discussion is closed to new replies.