
VB6 - Problem passing multiple parameters to Command SQL statement
I have a Command object - cmdUpdateData - that I've created in the data
designer in a data environment deMyEnv. The command contains a SQL
statement with three parameters, and looks like this:
UPDATE MyTable
SET Field1 = ?, Field2 = ?
WHERE (Field3 = ?)
Following the rather limited instructions in the MSDN library, I call
deMyEnv.cmdUpdateData from my application. Intellisense actually prompts me
with deMyEnv.cmdUpdateData(param1, param2, param3). After substituting
variables for the parameters, however, I get an error:
Compile Error
Expects =.
when I move to a new line. If I change the query to just one parameter,
VB doesn't complain. It seems though that when I have more than one
parameter it doesn't like that. I did test the query by filling in values
for each parameter in the properties dialog for the Command, and the update
query works fine.
Can anyone shed any light on this - I've tried about everything and can't
figure it out. Thanks, Ben.