If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: Calling Stored Proc. with optional parameter

I have an Access 2000 ADP that is linked to an SQL server database. I am trying to execute a stored proc. that has parameters with default values specified from within VBA code.

I was under the impression that if I specify which parameters I am adding by using the ado command object, that I would not have to pass in all of the parameters, rather I could specify the name of the parameter, and its value, and it would be set. When I try to do this however, if I have 5 parameters, and set 3 of them using the createparameter, it is the first 3 that are set, not the named ones that I specify.

thanks

yeah - thanks....have since found out that you are right using the method that I put in the code sample, however it is possible can do it by adding the parameters by name as follows:
adoCmd.Parameters("@Value3") = 100