Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table not updated
Message
From
19/01/2006 20:28:48
 
 
To
19/01/2006 04:24:49
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01088290
Message ID:
01088740
Views:
7
>I'm using VFP 8.0 with .dbf tables. I got many complain from my clients that sometimes the tables were not updated.
>
>In the updating, after all the replaces and inserts, I have:
>
>
>dAll=.n.
>begin transaction
>select stock
>if tableupdate(.t.)
>   select stockdetail
>   if tableupdate(.t.)
>      select cust
>      if tableupdate(.t.)
>         dAll=.y.
>      endif
>   endif
>endif
>
>IF dAll
>   END TRANSACTION
>ELSE
>   ROLLBACK
>   WAIT WINDOW 'Rollback, call your dealer'
>ENDIF
>
>
>all the tables are Optimistic table buffering (5), I have around 15 tables to update.
>
>at the beginning, I'm very confident the code will work, but after I received so many complains from difference clients, I have no more confident. none of them got the Rollback message but some of tables were not updated.
>
>am I missing something?
>
>please advise.
>
>regards,
>
>Jerry

TRY
dAll=.n.
begin transaction
select stock
if tableupdate(.t.) AND GETNEXTMODIFIED(0)=0
   select stockdetail
   if tableupdate(.t.) AND GETNEXTMODIFIED(0)=0
      select cust
      if tableupdate(.t.) AND GETNEXTMODIFIED(0)=0
         dAll=.y.
      endif
   endif
endif

IF dAll
   END TRANSACTION 
ELSE
   ROLLBACK
   WAIT WINDOW 'Rollback, call your dealer'
ENDIF
**************************

I have add GETNEXTMODIFIED(0)=0, but when I tried to run it, I got an error:

ERROR#: 1596
MESSAGE: Table buffering is not enabled
PROGRAM:
LINE:
CODE: IF TABLEUDATE(.t.) AND GETNEXTMODIFIED(0)=0

I've had all the table in DataEnvironment set to Optimistic table buffering (5), and I tried to add SET MULTILOCKS ON in DE BeforeOpenTables Event, or at the form.Init, or at the beginning of BEGIN TRANSACTION, with no luck.

please help

regards,

Jerry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform