Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RollBack
Message
From
17/10/2001 03:12:52
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
17/10/2001 02:41:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00569416
Message ID:
00569420
Views:
23
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform