> >lcsql = "UPDATE jcjob SET jcjob.name = " + CHR(34) + ; > ALLTRIM(cCoName) + CHR(34) + ; > " where jcjob.jobnum = " + Alltrim(nCoIId) > > IF sqlprepare(lnhandle,lcsql)>0 > IF sqlexe(lnhandle) > 0The error is sqlexe(lnhandle). You should have already tested to see if you have a valid connection handle. Plus, you do this without doing it in a SQLExec() function.
IF lnhandle < 1 && bad handle, no connection return .f. ENDIF lcsql = "UPDATE jcjob SET jcjob.name = " + CHR(34) + ; ALLTRIM(cCoName) + CHR(34) + ; " where jcjob.jobnum = " + Alltrim(nCoIId) IF sqlprepare(lnhandle,lcsql) > 0 && execute sql here and other code lnRetVal = SQLEXEC(lnHandle) if lnRetVal < 0 && SQL Update Failed else && SQL Update Succeeded endif ENDIF