Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Karben Selim Mejia
  Where is Karben Selim Mejia?
 San Pedro Sula
 Karben Selim Mejia
 To: Khalil Shaddad
  Where is Khalil Shaddad?
 Khalil Shaddad
Subject: RE: Locking Appended record
Thread ID: 16253 Message ID: 16258 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Monday, October 14, 2002 4:52:48 PM         

> Hi,
> I have one form with the following conditions:
> 1- private data session (this is a must)
> 2- optimistic row buffering (could be pessimistic but should be row buffering mode)
> 3- multi-user, multi-session in one user environment.
> 4- each bufferred record should be locked (this is a must).
> Lets say mytable has 10 records, if I APPEND BLANK twice [before issuing TABLEUPDATE()] in the same process or with two different processes I am getting RECNO() = 11 and here the problem comes. How to lock the appended record before or after tableupdateing without moving to another record?
> Khalil Shaddad (Lebanon)

Not really sure if this is what you are talking about but I guess that you can use the Multilocks on like this

set multilocks on    && Multilocks should be ON in order to lock several record at once
SET REPROCESS TO 3 AUTOMATIC  && This indicates to Foxpro that It should attemp to lock the recors just 3 times
STORE '1,2,3,4' TO gcRecList           && ID of the records you want to lock
USE YourTable
go top

? RLOCK(gcRecList, 'YourTable')  && Trys to Lock the 1st 4 records in YourTable , it succeed returns .T., .F. if doesn't. This doesn't move the cursor

UNLOCK IN prueba

hope this helps


Karben Selim Mejia

I always have the last word in my home, "Yes sweet heart, what ever you say"

Honduras, Central America
The very center of the world


Locking Appended record Posted by Khalil Shaddad @ 10/14/2002 12:49:32 PM
RE: Locking Appended record Posted by Karben Selim Mejia @ 10/14/2002 4:52:48 PM
RE: Locking Appended record Posted by Boudewijn Lutgerink @ 10/17/2002 8:14:19 AM
RE: Locking Appended record Posted by Khalil Shaddad @ 10/18/2002 10:35:24 AM