I am confused as to the manner in which cursor adapters operate in relation to transactions in a VFP9 SP2 front end /SQL Server back end.
I issue the T-SQL Begin transaction command and then set the transactions to manual. Then I start saving to each individual table with an insert to the cursor adapter and then a tableupdate. The tableupdates always return succes, then I issue the T-SQL commit transaction command, followed by the setting of transactions to automatic.
Yet, when I check the SQL tables, nothing was saved. I create the cursor adapters with the optimistic table buffering setting (5).
Example of what I do:
sqlexec(nHandle,'BEGIN TRANSACTION')
sqlsetprop(nHandle,'Transactions',2) && manual
insert into cursoradapter1....
lOK = tableupdate(.t.,.t.,'cursoradapter1')
if lOK
insert into cursoradapter2
lOK = tableupdate(.t.,.t.,'curadapter2')
endif
if lOK
sqlcommit(nhandle)
else
sqlrollback(nHandle)
endif
sqlsetprop(nHandle,'Transactions',1) && automatic
However, nothing gets saved to the SQL Tables
Why?
Rafael Copquin
Treasurer - Microsoft Users Group of Argentina (MUG)
www.mug.org.ar