>Is there a command in 2.6 equivalent to VFP RLOCK(0) to lock the header record. What we need is some way to lock the header to enable us to append data in a multi-user environment. In VFP, you can issue an RLOCK(0) where the parameter is the record number. If you issue this call in 2.6, it expects the work area as the parameter!
>
>We need to do this to enable us to have control over what to do if we cannot append the data to the file. Reprocess is not an answer, we have looked at that.
>
>Can anybody help???
Hi Nigel,
FWIW, I solved this problem in 2.0 by using the INSERT INTO command rather than the APPEND BLANK command. I first SCATTER MEMVAR BLANK then set all the memory variables which were created by that command to the values I want the new record to contain, and then I issue INSERT INTO (DBF()) FROM MEMVAR. This command does everything for you. It locks only the header, appends a new record, and gathers the variables into the new record, and then unlocks the header. Of course you have to handle the rare event when someone else has the header or the entire file locked which generates error 108, but that's not too difficult.
HTH
Sam
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement