>>
>>What Dave told you is also good because you should have a mecanism of assigning primary key like using a TABLE.DBF to act as a data dictionary which can then be used to know the next value of the primary key and for
>the locking mecanism.
>
>While on this subject I had another question. Do you increment the value in the table and then retrieve the new key or do you retrieve the key (+1) and then increment the value in the table. Is there a reason for doing one rather than the other?
doesn't matter as long as a) is consistent and b) rlock is done before those two steps and released after those two... to me, it makes more sense to get val and then increment.