Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TABLEUPDATE Help!!!
Message
From
18/03/1999 11:09:22
Ian Matthews
Up & Running Technologies Inc
Chestermere, Alberta, Canada
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
TABLEUPDATE Help!!!
Miscellaneous
Thread ID:
00199241
Message ID:
00199241
Views:
50
On tables that have OPT ROW BUFFERING (i.e. #3 set in DATA ENVIRONMENT), should TABLEUPDATE(.T.) cause an error when when two users have changed data in the same table at the same time. 'Cause I thought it was supposed to!

I have several tables open at once on a given form. Before my SKIP+1 code I have:

< SELECT A
< TABLEUPDATE(.T.)
< SELECT B
< TABLEUPDATE(.T.)
< SELECT C
< TABLEUPDATE(.T.)

and then

< SKIP +1 code

I have an ON ERROR routine that goes something like:
< CASE error() = 1585 or error()=1595 &&UPDATE Violation
< ask=MESSAGEBOX("Update violation in "+alias()+Chr(13);
< "Someone else modified the same record at the same time"+chr(13)+;
< "You now have two choices:"+chr(13)+;
< " OK = OVERWRITE THEIR changes, or;"+chr(13)+;
< " CANCEL = To UNDO YOUR changes.", 1+48+256, "ERROR: UPDATE VIOLATION")
< IF ask = 1
< TABLEUPDATE(.t.,.t.)
< ELSE
< TABLEREVERT(.t.)
< ENDIF

Apparently, contrary to all of the doc I have read, TABLEUPDATE(.T.) does not cause an error() when there is a conflict. In my case, the error only occurs when I try to SKIP+1. To verify this I:
1: created a button with nothing but my TABLEUPDATE(.t.) code
2: launched my .exe twice
3: edited the same record in each of the two 'sessions'
4: moved one of the 'sessions' to the next record using my 'SKIP+1' code (which has TABLEUPDATE code before the SKIP+1)
5: clicked my TABLEUPDATE ONLY button in the second 'session'
BUT NOTHING HAPPENED!!!! No ERRORS!!! Why NOT???? Errors only occured when I tried to SKIP+1 in the second 'session'. This meant that my error trapping code did not function because the selected table for SKIP+1 was NOT the table that had the problem.

The solution (I think) is to get TABLEUPDATE(.T.) to cause the error and not SKIP+1 but how the @$@#$ do I do that?

Ideas????
Next
Reply
Map
View

Click here to load this message in the networking platform