Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table Buffering, Detecting a Record Delete by Another Us
Message
From
17/09/1997 11:07:23
Glenn Mcburney
Doe(Ni) Information Systems Unit
Belfast, United Kingdom
 
 
To
16/09/1997 17:17:17
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00050289
Message ID:
00050396
Views:
21
>In VFP5 how do I detect if another user has deleted the current record when table buffering is used?

Dan,

I have used a couple of simple methods which seem to work

1. Search for the recno of the record to be deleted

lrecno = recno()
select recno() from MYTABLE where recno()=lRecno into cursor TEMP
if _tally = 0..................


2. create a UD method to include something like -

local lRecno,lRecno2,lSame
lSame=.t.
&& Save the record number of the record displayed
lRecno=recno()
&& Skip forward and back to the current record
ThisForm.LockScreen = .t.
skip
skip -1
&& Save the record number of the current record
lRecno2=recno()
&& If the two recnos are different then the record you were on has been deleted
if lRecno<>lRecno2
lSame=.f.
endif
ThisForm.LockScreen = .f.
return lSame

If the check is to be done at TableUpdate stage trap for error 1585 - 'Update conflict' and use 1. to confirm if it has been deleted.

HTH.
Glenn
DOE(NI), Belfast
Previous
Reply
Map
View

Click here to load this message in the networking platform