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.
Do I have the wrong impression about how this works, or have I got a problem with my code??
I am using the commands as shown below...
stored proc defined as:
Create proc SP (@value1 int = 0, @value2 int = 1, @value3 int = 2)
Set adoCmd = CreateObject("ADODB.Command")
adoCmd.CommandText = strProcName
adoCmd.CommandType = adCmdStoredProc
Set objNewParam = adoCmd.CreateParameter("value1", adinteger, adparaminput, , 6)
Set objNewParam = adoCmd.CreateParameter("value3", adinteger, adparaminput, , 100)
This appears to set the parameters @value1 and @value2, not @value1 and @value3 as desired...
Any help greatly appreciated...