Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Algorithm for generating unique value for the 6 char fie
Message
De
05/05/2001 13:03:45
 
 
À
05/05/2001 11:34:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00503649
Message ID:
00503917
Vues:
31
Yes.

Don't use the Tastrade app method of generating IDs :-)

Seriously, though, I suppose you could assign a temporary number through that NewID function and then replace it with the "real" sequential number on save. But that would be a bear to implement with child tables requiring the ID as a foreign key.

Honestly, I just don't use sequential numbers as primary keys. I use SYS(0)+SYS(2015) or a GUID for a primary key and the user never sees it nor can modify it. If I need a sequential ID number, I grab the next off the stack when the new record is saved.

>In the tastrade app,when the user adds a new record the ID's are incremented,but if the users add a new record but didn't save the record and exits and the next time add a new record,the id's are incremented,that is the id's are not rolling back if the user didn't save it,how to avoid this any ideas!!!
>
>Thanks
>AK
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform