Hi Lynn,

You can store your next number to use in its own table. Then when you 
want to grab the number just put a lock on the table, grab the number and 
then increment it and save it back into the table. Then release the lock. Write 
a routine that will let people try every second for 3 trys to get a new number. 
If they don't get one by the third try then there is either a problem or you 
have a whole ton of people using the application at the same time. The 
routine should only take milliseconds to execute.

If you want to get fancy you can test if they entered a row and if not, and 
nobody else has grabbed a higher number, then you can write it back so it 
can be used again. Otherwise you can insert some kind of null row so you 
know that all rows are accounted for.

I have written a routine that I can email you if you want it. Just send me a 
private email.

Best Regards,
Mike Young
[EMAIL PROTECTED]

On Tue, 10 Jul 2001 21:36:48 -0600, Lynn Shelton wrote:

>Due to some programming constraints, I have to do my own autonumbering 
field
>management - i.e. not using the standard autonumbered column method.  I 
can
>do this with no problem on a stand-alone application, but I am concerned
>with potential problems if the application is adapted to operate on a
>network in multi-user mode.
>
>I remember a couple of years ago a pretty good discussion on methods for
>doing one's own autonumber routine that avoids duplicate numbers being
>assigned in a multi-user situation.  I had this discussion printed out at
>one time, but have lost it.  Can some of you give me some refresher
>hints/tips?  I have to have this application ready for demonstration in the
>next couple of days, so I will do my stand-alone (single-user) method for
>now, and hopefully modify the code later for conflict-avoidance in
>multi-user mode.
>
>TIA
>Lynn Shelton
>[EMAIL PROTECTED]
>
>



Reply via email to