Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The Easy Way to Form a Primary Key
Message
From
07/03/2002 09:22:39
 
 
To
07/03/2002 09:07:53
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00629497
Message ID:
00629526
Views:
14
Hmm thanks

I was a bit suspicious about that myself. The usual keytable methods lock the record in the keytable briefly to guarantee a unique key is returned.

That would not be possible in a muti user environment because a user might be editing the latest record.

Maybe this article should be amended to show this gotcha or perhaps removed.




>I have the initial impression that the function looks for the largest value already stored in the PK, and then increments one.
>
>If that is how it works, this won't work correctly on a network, especially with buffering.
>
>Hilmar.
>
>>The UT Article "The Easy Way to Form a Primary Key "
>>
>>http://www.geocities.com/vhpcg/primkey.html
>>
>>Looks like a great solution for generating primary keys.
>>
>>It does away with the need for a seperate key table and it needs no parameters to work correctly.
>>
>>It also looks like it solves the problem of the wrong keytable being used if you are working with 2 databases open
>>
>>I am considering adopting this code for some of my DBCs.
>>
>>I would like to know if folks have been using it happily, or can anyone spot any problems in the code.
>>
>>Many Thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform