I need a routine to generate a unique number for a key

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Due to reasons too complex to explain I need a routine to
generate a unique number for a key

I cannot use the autonumber Key feature for this since I MUST know the number before I add records. I must also be able to jump sequences in certain circumstances

I envision a table with one row 'next_number' which will
be accessed with exclusive lock and updated before lock is
released
Does anyone have reliable working code so I dont have to
reinvent the wheel
Also what happens if two users hit this routine at the
same time, do I need a short 'wait and retry' loop
I'm using ADO access in Access 2000. This is a multi-user
system.
 
Back
Top