Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HELP!!! Handle update conflict.
Message
 
To
15/09/2000 02:52:51
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00416762
Message ID:
00420170
Views:
20
>In my form, I use a botton to save the data.
>
>The data are save into 2 different table.
>
>How I handle if 1 of table have update conflict?
>
>What is the best error handling strategy?
>
>TIA.

E. C.,

Something like this would work for you;
* Save code

LOCAL llRollback

BEGIN TRANSACTION

IF NOT llRollBack AND NOT TableUpdate(1,.F.,"Table1")
   llRollBack = .T.
ENDIF

IF NOT llRollBack AND NOT TableUpdate(1,.F.,"Table2")
   llRollBack = .T.
ENDIF

IF llRollBack
   ROLLBACK
   TableRevert(.T.,"Table1")
   TableRevert(.T.,"Table2")
   MessageBox("Unable to save your work.  Try again later.",0,"Save Failed")
ELSE
   END TRANSACTION
ENDIF
RETURN NOT llRollBack
Previous
Reply
Map
View

Click here to load this message in the networking platform