Ups!, in the last mail the line [2] was incomplete, sorry, here is fixed.
>I know of no way to place a record lock on the table with all my keys using SQL.
The code in line [2] will place a record lock and the record will be released in line [4]. This is by definition and it is done automatically. The following code it is the core of a key generator routine.
[1]begin transaction
[2] update KeyTable set NextKey = NextKey + 1 where KeyTable.PK = ‘somevalue’
[3] select NextKey from KeyTable where KeyTable.PK = ‘somevalue’
[4]commit transaction
The above code will NOT generate dead-lock conditions because the use of begin transaction/commit transaction.
The table 'KeyTable' will be open automatically for you. Just make sure the database container (DBC) it is open.
> Are you recommending I change the use command to a SQL Select (Which should open the table)?
Yes. Well it is just an idea. I have no idea on the impact that this could have on your project.
Hector Correa