Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoiding Dublicate Field entries in a multi-user applica
Message
De
20/02/1998 13:12:54
 
 
À
20/02/1998 11:47:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00080125
Message ID:
00080150
Vues:
32
snip...
>
>First I wouldn't suggest recno() as a PK. Assuming still you want it :
>-Table where recno() is taken should be a another table.
>-Whenever you want to take recno(), lock the table, get your recno() and release lock.
>-For multiple tables, instead of just getting a recno(), keep an id at that particular table, for each of the tables, ie:
>Table_id, Lastrecno
>mycustomer 12
>myorders 23
>...
>You can see an example for this in solutions.app and tastrade.app (Both can be find in help\sample applications).
>-When you will get the recno() or id, lock the record or table. To prevent and endless lock attempt, "set reprocess to 1", try lock, if not locked continue trying lock with some delay.
>Cetin

Most programmers end up using something on this order. I have a different situaton where I have independent installations that may want to merge their data. I use SYS(3) to generate keys. One draw back is the number is nonsense and sometimes you would like to know the order records were added for audit purposes. Do you know of other draw backs to using sys(3)?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform