Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRANSACTION loosing my data. Why?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00322762
Message ID:
00323583
Views:
19
Eric,

You never did a TableUpdate on any of the work areas, that may be your problem.

Try this, move the begin transaction to after all of your data manipulation code and have it only wrap the TableUpdates as in;
* First all of your code that does the inserts and updates, then ...
LOCAL llRollBack
BEGIN TRANSACTION
   IF NOT llRollBack AND TableUpdate(1,.F.,"TheFirstAlias")
   ELSE
      llRollBack = .T.
   ENDIF
   IF NOT llRollBack AND TableUpdate(1,.F.,"TheSecondAlias")
   ELSE
      llRollBack = .T.
   ENDIF
   IF NOT llRollBack AND TableUpdate(1,.F.,"TheThirdAlias")
   ELSE
      llRollBack = .T.
   ENDIF
   IF NOT llRollBack AND TableUpdate(1,.F.,"TheFourthAlias")
   ELSE
      llRollBack = .T.
   ENDIF

IF llRollBack
   ROLLBACK
   * Remember the buffers are still dirty here.
ELSE
   END TRANSACTION
ENDIF
Previous
Reply
Map
View

Click here to load this message in the networking platform