Re: AutoInc in mdb



On Wed, 19 Mar 2008 14:04:18 -0000, limelect <limelect@xxxxxxxxxxxx> wrote:

But my question was the next one which is complicated if there is a way.?
PS. to get the last number do
close
open
last
and read the field!!

Even if I did know how to get the next number from an auto-increment field, I'm not sure that it would always be a sensible thing to do!

Unless you manage to lock that table completely, you cannot guarantee that any "next number" you read or calculate will actually be allocated to your row when you insert it sometime later (since any number of other threads/processes/users could have inserted new rows into the table during that period)

If this is the old problem: "I must know the next cheque number before I write this cheque but my accountants insist that there are never any gaps in the sequence" then I don't think that there is any (easy) solution.

--
Paul Scott
Information Management Systems
Macclesfield, UK.
.