SQLRollback and SQLCommit are used only when you are talking to a database
other than VFP.
You must use BEGIN TRANSACTION in order to use ROLLBACK or END TRANSACTION. Note VFP does not have a COMMIT command, in VFP you use END TRANSACTION instead.
From my previous example, just remove the calls to SQLExec() and that should work for VFP databases.
>Hi Hector,
>
>Thanks for the reply. I am not using SQL SERVER or ORACLE just a straight VFP database on the local server. Do I still need the BEGIN TRANSACTION ?
>
>I hoped I could just do:
>
>SELECT cursor1
>lUpdtOk = TABLEUPDATE(.T.)
>IF !lUpdtOk
> SQLROLLBACK(nMyHndl)
> MESSAGEBOX(advise user)
> RETURN
>ENDIF
>
>SELECT cursor2
>lUpdtOk = TABLEUPDATE(.T.)
>* Repeat for all cursors
>ETC…
>
>* If I made it here. All went well.
>* Issue this and the data is officially updated here.
>SQLCOMMIT(nMyHndl)
>
>Mike
Hector Correa