Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Easy Way to Form a Primary Key
Message
De
07/03/2002 09:22:39
 
 
À
07/03/2002 09:07:53
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00629497
Message ID:
00629526
Vues:
8
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform