Result = 0
NewObjectID = 0
cQuery = ;
[EXEC addObject] + ;
[ @objectname = '] + ALLTRIM(tmpProducts.prcode) + [',] + ;
[ @objecttype = 'P',] + ;
[ @Result = ?@Result,] + ;
[ @NewObjectID = ?@NewObjectID]
SQLEXEC(...)
? m.Result
? m.NewObjectID
>Borislav,
>
>having done some tuning I have noticed that something is still not functioning properly.
>Your solution worked fine and the error is gone. The problem, however, is that the values that should be returned by SQL-server are not retrieved by VFP.
>> [ @Result = ?m.Result,] + ;
>> [ @NewObjectID = ?m.NewObjectID]
>Both of them are empty. Checking with the profiler does show that SQL-server is setting them:
>-- AddObject
>set @NewObjectID = 200000
>and
>-- AddObject
>set @Result = 'Object of type ' + @ObjectType + ' and name ' + @ObjectName + ' added to the database, key: ' + STR(@NewObjectID)
>
>Do you have any suggestion on why this is happening?
>
>Thanks for you help.
>
>Regards,
>
>Ron Brahma
>
>>Try:
>>
>>Result= NULL
>>NewObjectID= NULL
>>cQuery = ;
>> [EXEC addObject] + ;
>> [ @objectname = '] + ALLTRIM(tmpProducts.prcode) + [',] + ;
>> [ @objecttype = 'P',] + ;
>> [ @Result = ?m.Result,] + ;
>> [ @NewObjectID = ?m.NewObjectID]
>>
>>
>>>Borislav,
>>>
>>>Thanks! I didn't think about this. I tried your suggestion and it is returning:
>>>"Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Must declare the variable '@Result'."
>>>
>>>I am changed my update to:
>>>
>>>Result= NULL
>>>NewObjectID= NULL
>>>cQuery = ;
>>> [EXEC addObject] + ;
>>> [ @objectname = '] + ALLTRIM(tmpProducts.prcode) + [',] + ;
>>> [ @objecttype = 'P',] + ;
>>> [ @Result,] + ;
>>> [ @NewObjectID]
>>>
>>>
>>>
>>>But the result it still the same.
>>>Can you give me a hint on how to do this.
>>>
>>>Thanks in advance,
>>>Ron Brahma
>>>
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.