Hello all!
I have the following situation:
I'm using 3 tables with buffering mode 5. I'm collecting the data to update the tables using a form with an empty data environment (using variables as ControlSources for form's controls). Finally, I'm saving the values using the following code (simplified):
BEGIN TRANSACTION
INSERT INTO table1 (fields from table1) VALUES (some values)
INSERT INTO table2 (fields from table2) VALUES (some values)
SELECT table3
LOCATE FOR some_condition
IF FOUND()
some code
ELSE
INSERT INTO table3 (fields from table3) VALUES (some values)
ENDIF
llUpdt=TABLEUPDATE(.T.,.F.,table1)
IF llUpdt
llUpdt=TABLEUPDATE(.T.,.F.,table2)
ENDIF
IF llUpdt
llUpdt=TABLEUPDATE(.T.,.F.,table3)
ENDIF
IF llUpdt
END TRANSACTION
ELSE
ROLLBACK
TABLEREVERT(.....)
......
ENDIF
Problem: The first two tables are updated but not the third! When I issue the third TABLEUPDATE (for table3), apparently the table is updated (I see in status bar that the number of records is incremented by 1) but when is executed 'END TRANSACTION' number of records are decremented by 1 and the new record disappear!!!
Have anyone some suggestions?
Thanks!
I have the following situation:
I'm using 3 tables with buffering mode 5. I'm collecting the data to update the tables using a form with an empty data environment (using variables as ControlSources for form's controls). Finally, I'm saving the values using the following code (simplified):
BEGIN TRANSACTION
INSERT INTO table1 (fields from table1) VALUES (some values)
INSERT INTO table2 (fields from table2) VALUES (some values)
SELECT table3
LOCATE FOR some_condition
IF FOUND()
some code
ELSE
INSERT INTO table3 (fields from table3) VALUES (some values)
ENDIF
llUpdt=TABLEUPDATE(.T.,.F.,table1)
IF llUpdt
llUpdt=TABLEUPDATE(.T.,.F.,table2)
ENDIF
IF llUpdt
llUpdt=TABLEUPDATE(.T.,.F.,table3)
ENDIF
IF llUpdt
END TRANSACTION
ELSE
ROLLBACK
TABLEREVERT(.....)
......
ENDIF
Problem: The first two tables are updated but not the third! When I issue the third TABLEUPDATE (for table3), apparently the table is updated (I see in status bar that the number of records is incremented by 1) but when is executed 'END TRANSACTION' number of records are decremented by 1 and the new record disappear!!!
Have anyone some suggestions?
Thanks!