Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RollBack
Message
De
17/10/2001 03:12:52
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
17/10/2001 02:41:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00569416
Message ID:
00569420
Vues:
24
This message has been marked as the solution to the initial question of the thread.
>Hi all
> A simple question ?
>
>
     sele stockout
>     replace ** with ***
>     begin transaction
>     lnoerror = tableupdate(.F.,.T.)
>*     if lnoerror <b>&& don't need this: = .T.</b>
>         sele items
>         replace ..... with .....
>         lnoerror = <b>lNoError and</b> tableupdate(.F.,.T.)
>*     endif
>*     if lnoerror <b>&& don't need this: = .T.</b>
>         sele invoice
>         replace .... with ......
>         lnoerror = <b>lNoError and</b> tableupdate(.F.,.T.)
>*     endif
>*     if lnoerror <b>&& don't need this: = .T.</b>
>        sele debtor
>        replace ...... with .......
>        lnoerror = <b>lNoError and</b> tableupdate(.F.,.T.)
>*     endif
>     if lnoerror = .F.
>         RollBack
>     else
>         end transaction
>     endif
>if debtor can't update, will rollback revert stockout, invoice, items tables ?

Yes, that's how VFP works. I've added a few suggestions in code above. Actually, you don't have to check for lNoError each time, because the final test will roll them all back, or commit the whole transaction. Just trying to have as little code inside transaction as possible, because it's recommended that you should it the shortest you can. While transaction is in progress, locks are applied and held on all the affected records.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform