Hi all<BR><BR>What is the best method of locking a database table?<BR>My situation is that I want to insert a record into the table which has<BR>autonumber field called ID. After I insert this record, I want to grab the<BR>ID record for the record just enterred. I can find this by grabbing the last<BR>record in the table with a select statement.<BR>HOWEVER<BR>In a multi-user environment, it is theoretically possible for another user<BR>to do the same insert statement into the database a moment after the first<BR>insert statement which will cause the second select statment to be<BR>incorrect.<BR><BR>Can this situation be solved using standard techniques? I wouldn&#039t think<BR>that the use of recordset locking procedures would help because the rs is<BR>closed after the first SQL statement (insert) and openned afresh for the<BR>second statement (select).<BR><BR>I think there may be solution by using application variables to lock the<BR>process at the start then unlock it at the end, but when the second user<BR>tries to do the same job, and the table is locked, what do I get them to do<BR>in the meantime (in asp terms of course)<BR><BR><BR>Any help would be greatly appreciated!<BR><BR><BR>Steven Tye<BR><BR>