> Matt, your method will surely work. The only problem is exclusive opening
> especially if it's part of dbc. RLOCK() will provide uniqueness the same
> way and with less overhead.
> >
> >--
Ed, your're absolutely correct. My only concern is that I've heard that
on busy networks, RLOCK() doesn't always handle the buffer properly. It
sometimes flushes the buffer AFTER the record is unlocked, thereby
allowing the potential for two users to grab the same id before either
increments it.
If the setup table is a single records and is required to be opened
exclusively for small/quick reference transactions and then closed, the
overhead can be reduced toa minimum.
BEGIN..END TRANSACTION also allows the use of ROLLBACK, so if the
transaction is cancelled, the counter can be reset.
In the end, i think ot all depends on what you're planning to do with
it. Either way works.
Matt
Matt McDonnell
...building a better mousetrap with moldy cheese...