Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locking Records on ASP form during edit 1

Status
Not open for further replies.

ahmun

IS-IT--Management
Jan 7, 2002
432
US
Hi all...

I'm wondering if someone can give me some tips on how to go about locking a record on an ASP page before I jump in with both feet...

With most ASP pages accessing database info with ADO, the common practice is to open a recordset, grab the values, and close the recordset; then set it to nothing...

I am wondering if there is a way to maintain a lock on a record after a user has opened the asp page and is working through the fields.

I'm thinking of adding a boolean field to the record table as a flag to indicate whether or not a user is editing that record. The to write some Script to kick all other users out if that flag is set to true.

Is there a better way about this?


Earnie Eng
 
See my reply to thread333-980438, towards the end. I explain how to do it using a datetime field that is considerably better than a boolean lock (you'll see why there). IMO, of course.
 
Thank you Genimuse...

that's exactly what I was looking for. And yes.. I did think of putting a timeout field... but was thinking of both a boolean and a timeout... duh... makes sense to just have the timeout field and a static past date.

As far as database size... would it make more sense to have a seperate table such as a tblLockedRecords that contains for its fields the ID of the record and a timeout date/time field...

if I had a database with thousands of records I essentially multiply my DB size by that many records in terms of the added date/time field in my table?

Or does access not allocate memory if the field isn't set? (set to null or something)


Earnie Eng
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top