AboutSrini Nagarajan Expertise I can answer any kind of questions in ASP.NET, C#, VB.NET, SharePoint 2007, ASP, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase
Experience Contact me if you need any custom development on ASP.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder.
Expert: Srini Nagarajan Date: 3/26/2008 Subject: Pessimistic Record Level Locking of SQL Table
Question I have ASP front end application and SQL Server 7.0 backend database. When a user updates a record on the ASP page, I want that record to be pessimistically record level locked so that no other person can edit or update the record. But other users can edit and update other records in this SQL table. Can you direct me to some sample code that will carry out this operation? Or tell me at what part of the ASP code I need to add new codes? I have one ASP page where you enter the customer id number and then the request is sent to SQL Server where it returns the particular recordset and populates a 2nd ASP page. When a user is editing this page, the record level lock will prevent other users from editing the same record. Thank you.
Answer Hi,
You need to do the following steps since you are using SQL server 7.0 and Classic ASP
1. First create a Application variable called "UpdateRecs"
2. When you retrieve the record for edit update the "UpdateRecs" something like this