Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to know records were edited or deletion by Other use
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00430813
Message ID:
00431039
Views:
10
Personelly I would trash that and start over and use the rlock() function

for everything edits, deletes the first line of code after hitting edit or after conferming the delete do a

set reprocess to auto
if rlock()
do your stuff
else
wait 'locking record' window
endif

No taking advantage of the rlock() function really makes things to complex and way to much code to write

>Sorry, I post this again to send this as reply to all other members of this thread
>
>>If i use CURVAL or OLDVAL, both return correct value and I can know the changes, but It need to loop through all of the fields.
>>
>>
>>Any ideas?
>
>Whats the problem? This operation is quick because it works with buffered data in memory. Sample of updating session with checking for changes on the server:
>
>
>if !tableupdate(.F.,.F.) && when cannot update, check if reason is changes on server
>  local lnFieldIndex, lcFieldName
>  select MyAlias
>  for m.lnFieldIndex = 1 to FCOUNT()
>    m.lcFieldName = Field(m.lnFieldIndex)
>    if type(m.lcFieldName) == 'G' && skip general fields
>      if !(OldVal(m.lcFieldName) == CURVAL(m.lcFieldName))
>        * Oops - something changed on the server by another user - prompt to overwrite
>        ...
>        if !llOverWrite && if user answered to do not overwrite
>          && update current value by changed value from server
>          replace (m.lcFieldName) with CURVAL(m.lcFieldName)
>        endif
>      endif
>    endif
>  ENDFOR
>  * WARNING - special checking for deleted records
>  if CURVAL('Deleted()')
>    * Oops - record already deleted by another user
>    * ask to recover it or keep deleted
>    ...
>    if llRecover && if user answered to recover record
>      && following 2 commands needed to assure correct update on server
>      delete
>      recall
>    else
>      && delete record in local buffer as well
>      delete
>    endif
>  endif
>
>  if !tableupdate(.T.,.F.)
>    && error - cannot update at all
>  endif
>endif
>
Stephen McLaughlin
"Sexy Steve Valenteno", "Blastmaster"
stephenmclaughlin@gmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform