Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multi user
Message
De
07/09/1999 12:56:59
 
 
À
07/09/1999 10:57:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00261948
Message ID:
00262009
Vues:
20
>Hi,
> I have a table which store the last ID generated for my invoise. It will be access and updated by every user.
>I have a problem that, what type of buffering should be used for this if only this record will be used for ID generation?

No buffering, with an explicit lock and unlock of the file.

> How to re-use the ID if some body cancel the ID before inserted?
>

You can't reliably do this, since there is no simple way to determine if someone else has allocated another key subsequent to your decision to release the key back to the pool. The only way to accomplish this would require a table of all unassigned keys so that you can recirculate keys. In general reusing a key causes far more trouble than it might be worth - simply allocate a key field large enoguh to not run out of keys, and ignore than some keys aren't being used.

>Thank you
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform