Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HELP!!! Handle update conflict.
Message
 
À
15/09/2000 02:52:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00416762
Message ID:
00420170
Vues:
21
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform