I went to your website. I really liked your article on Primary Keys. What annoys me about the article is how much work it has created for me. :-) Cutting out the garbage code I put in!
I have seen other articles similar in nature, but obviously poorly described. Such as:
Create the table "Keys" (Same as you)
Assign the values there (Same as you)
Assign the values to the data file (Same as you)
The ommission is the FLOCK() to the Keys table to ensure exclusive access and where to put the code.
I have already used that code for testing purposes. I modified it to figure out the MAX(ID) and increment by 2 for it's first use because my applications are already using Numeric IDs (my garbage code way.) This way the Keys table can be blown away, and the first time it is used it will start at the correct value.
All of my tables already use a tcTable + "_ID" field so pulling the MAX(ID) is easy. It's pretty cool to see it work with a Ctrl+Y while browsing the table!
Thanks again for a well written article and code.