Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unique ID increment
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00128168
Message ID:
00128350
Vues:
26
Partly agree,

because go bottom will assume that the last record SHOULD NOT be deleted!
else the last key will be reused but correspond data may be wrong.

But another problem is that, there should be a lock for external last key lookup
else if two or more instance still watch the lastkey lookup table but have not
enough time to write it....
The action will be completed when there is a check on the lastkey lookup table has record lock or not! if lock, retry for few seconds....



>>In the record validation rule for the table I do something like this
>>
IF EMPTY(TheMainKeyField)
>>  USE (DBF()) AGAIN IN 0 ALIAS AutoNumber ORDER TheMainKeyIndex
>>  GOTO BOTTOM IN AutoNumber
>>  REPLACE TheMainKeyField WITH AutoNumber.TheMainKeyField+1
>>  USE IN AutoNumber
>>ENDIF
>
>Bear in mind that this won't work in a multi-user situation, where two users might grab that record at the same time. The separate table for keys works better here.
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform