>>>Hi,
>>>
>>>I am testing a parameterized update command (for SQL Server database) and having a problem. Here is my code:
>>>
>>>cSqlUpdate = "update mytable set field1 = ?" + cNewFld1Val + ", field2 = ?" + cNewFld2Val + " where pk = 10"
>>>lnResult = SQLEXEC( nSqlHandle, cSqlUpdate)
>>>
>>>I get a prompt to enter a value (as if I didn't specify the values cNewFld1Val or cNewFld2Val.
>>>Is this possible because the value of cnewFld2Val has a question mark ("?")?
>>>
>>>TIA
>>
>>cSqlUpdate = "update mytable set field1 = ?cNewFld1Val , field2 = ?cNewFld2Val where pk = 10"
>>lnResult = SQLEXEC( nSqlHandle, cSqlUpdate)
>
>Do the variables cNewFld1Val and cNewFld2Val have to be Private? I have them Local and they are in scope with the above command. But I am not getting results I expect. So, I thought maybe this is the problem.
>Please let me know. Thanks.
Yes, this is the only case I know of where you need to declare the variables as private.