>Hi all,
>
>I'm having a problem with an application sometimes confusing 2 records in a table. happens about once a week. Anyway I'm going over the code and I use scatter...append blank...gather in some places. I'm wondering if I change this to an insert command does the insert command automatically lock either the table or record while inserting. I'm trying to find out online but nothing explicit is popping up. It is VFP code and a VFP table.
I guess VFP indeed locks prior to inserting a new record. Not the entire table, but 'record 0', which is a virtual recordnumber, also called the headerrecord. And after the insert it is released for use by others who want to insert. If an insert requires a value that must be unique - let's say a unique identifier - then it's wise to lock record 0 by hand beforehand.
do while not rlock( '0', alias() )
enddo
unlock record 0 in ( alias() )
Groet,
Peter de Valença
Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.