Avatar of skimox
skimox
Flag for United States of America asked on

Record locking on classic ASP

I need to do record locking in classic ASP.  I was able to get it working in ASP.NET using System.Transactions code on the same system that the classic ASP code is running.  The problem is protecting (linearizing access to) the classic read-modify-write cycle on a single record in an SQL Server 2012 database table.
Conceptually I need to do the following simple steps:
    lock_record()
    select cur_value from value_tbl where id_val = 1;
    next_value = cur_value + 1
    update value_tbl set cur_value = next_value where id_val = 1;
    unlock_record()
ASPASP.NETSQLWeb Development

Avatar of undefined
Last Comment
skimox

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Steve Bink

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
skimox

ASKER
Okay thanks Steve I will give it a try.  The example in the link you provided is in VB, not VBScript, so I will have some work to do.

I agree ASP.NET is much better than ASP but we have so much code written in ASP that converting it all to ASP.NET would be a huge project and is not feasible right now.

I did try to get ADO transactions to work in ASP but was unsuccessful.  Are there some versions of SQL Server that don't support transactions?  I know there are more expensive versions of SQL Server 2012 than what we have but I don't know how to check what version we have.  Clicking "About" on the SSMS Help menu doesn't tell me.
skimox

ASKER
Thanks very much Steve, I got it working.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23