>>>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
You ALWAYS should check what SQLEXEC returns and use AERROR() to get the error:
TEXT TO lcsqlcommand NOSHOW
delete JobList where TRIM(accountno)='DG34214' -- use single quotes here
ENDTEXT
IF SQLEXEC(gnConnHandle,lcsqlcommand) < 0
AERROR(laError)
MessageBox(laError[1,2])
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.