Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi user
Message
From
07/09/1999 12:56:59
 
 
To
07/09/1999 10:57:24
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00261948
Message ID:
00262009
Views:
19
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform