Re: how to transactions with Cursoradapters and sql



Hello,

set the UseTransaction property of the CursorAdapter to .F.

Additionally sending BEGIN TRANSACTION/ROLLBACK commands over SQLEXEC is not recommend since the ODBC driver state can get out of sync.

Use the provided FoxPro functions instead.

&& switch to manual transactions
SQLSETPROP(yourConnection,'Transactions',2)
IF TABLEUPDATE(.T.)
	SQLCOMMIT(yourConnection)
ELSE
	SQLROLLBACK(yourConnection)
ENDIF
&& back to automatic transactions
SQLSETPROP(yourConnection,'Transactions',1)

Regards
Christian
.