Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ID field
Message
From
17/11/2006 10:43:38
 
 
To
17/11/2006 09:22:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01170010
Message ID:
01170704
Views:
15
>>Hi everybody,
>>
>>AFAIK there is no way in multi-user environment to have ID field incremented correctly without using extra table to keep the last ID (if we're not using autoincrement field). Using go bottom, grab the last number and start from there doesn't prevent two users from taking the same ID. Even if we put a check right after for the existance of ID.
>>
>>What do you think? Given only one table and no auto-increment is it possible to correctly auto-increment in multi-user environment?
>>
>>Thanks.
>
>RLOCK(0) with a GET MAX(ID)+1 over an indexed ID is the solution.
>
>It is equal to the extra table solution
>( the index is the surrogate of the extra table )

Your RLOCK(0) would produce an error. See: Re: ID field Thread #1170010 Message #1170230
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Reply
Map
View

Click here to load this message in the networking platform