Hi again,
I'm aplying the good code from Jim Booth for doing transactions, and everything is ok, well I have a problem:
I update i.e. three tables: table1, table2 and table3
in table1 I delete one record
and in table2 and table2 I create one more, just a sample.
The problem is cause I have a field in table1 to track the datetime when a record is deleted (dtdeleted field)
I use:
SELECT table1
REPLACE dtdeleted WITH DATETIME()
llret = TABLEUPDATE(1,.F.,"table1")
DELETE
I cannot do with this:
SELECT table1
REPLACE dtdeleted WITH DATETIME()
DELETE
llret = TABLEUPDATE(1,.F.,"table1")
cause the replace is ignored!! ???
... add records to table2 and table3...
and then BEGIN TRANSACT.... in Jim's way
the problem is if the transaction fails, the tableupdate before the DELETE doesn't reverts (I know this is normal).
But how can do for reverting ALL in the transaction?