View Full Version : Parametrized Pass-Through Query


accesser2003
07-14-2008, 02:54 PM
I created a stored procedure called BuildAttendanceEvents_GroupByEmp
the parameters of this procedure is @LoadFrom, @LoadTo

To run this stored procedure from the MS Access, I created a pass-through query, at the Database Window. This query is connected to the same database where the stored procedure is located at. In this pass-through query, I wrote the following code to run it:

DECLARE @LoadFrom datetime, @loadTo datetime;
EXEC BuildAttendanceEvents_GroupByEmp @LoadFrom, @LoadTo;



I was expecting that this pass-through query will ask me to enter it parameters values, but it didn't ask.

Thus, how can I convert this pass-through query to a parameterized query specially if I would like to automate it??

Thanks,

MSAccessRookie
07-14-2008, 03:02 PM
I don't think that the called parameter needs to have the same name that the stored procedure uses. It is my understanding that the only requirement is that the data types be exactly the same. Have you tried just plain:

DECLARE LoadFrom datetime, loadTo datetime;
EXEC BuildAttendanceEvents_GroupByEmp LoadFrom, LoadTo;

My apologies in advance if I am in error here.

accesser2003
07-14-2008, 03:05 PM
What you said is not correct. HowEver, thanks for reply.