Access97 Record Locking

  • Thread starter Thread starter katz
  • Start date Start date
K

katz

Hello!
I'm creating about a 1000 records at a time to a table thru code. I want the
RecordNo's should be in sequence and I don't want other user should add new
records until I'm done. I would like to lock the table in the beginning of
the processing and release when I'm done. Can anybody show me and give me an
example how to lock and unlock a table thru code!

Thanks
Abek katz
 
Hello!
I'm creating about a 1000 records at a time to a table thru code. I want the
RecordNo's should be in sequence and I don't want other user should add new
records until I'm done. I would like to lock the table in the beginning of
the processing and release when I'm done. Can anybody show me and give me an
example how to lock and unlock a table thru code!

Thanks
Abek katz

As Panja says, don't confuse an Autonumber value with a "record
number". It isn't one. An Autonumber has one purpose, and one purpose
only: to provide a unique key. It is NOT guaranteed to be sequential
or to be free of gaps, and should not be used in a way which depends
on that assumption!

That said... open a Recordset exclusively. Look at the VBA help for
the OpenRecordset method. If you open it, add your records, and then
close it, your numbers should be sequential within that block (no
guarantees about gaps outside the block though).

John W. Vinson[MVP]
 
Back
Top