>>>>The following commands in a VFP program should delete from an sql database all records for the appropriate accountno but nothing happens
>>>>
>>>>
>>>> lcsqlcommand ="delete JobList where TRIM(accountno)=DG34214"
>>>> lnresult = SQLEXEC(gnConnHandle,lcsqlcommand)
>>>> select sqlresult
>>>>
>>>>What have I done wrong?
>>>
>>>For starts Colin if you ran that command in SQL it would not work. You need quotes round the string.
>>>
>>>"delete JobList where TRIM(accountno)='DG34214'"
>>
>>If I put quotes around the string I get a compile error
>
>BTW, why do you use TRIM function? Are you saving your data with spaces at the beginning of the string? Using TRIM function will not allow SQL Server to take advantage of the index if you have it for the accountNo column.
this is my code
TEXT TO lcsqlcommand NOSHOW
delete JobList where accountno='DG34214'
ENDTEXT
Specialist in Advertising, Marketing, especially Direct Marketing
I run courses in Business Management and Marketing