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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordset/Record Locking 1

Status
Not open for further replies.

B827

Technical User
Feb 14, 2002
281
GB
I have a couple of fairly simple applications which allow users to add and update records. These are user specific so there is problem with two people modifying the same record simultaneously with all the problems that entails.

I have been wondering, if we expand this, how do I prevent two people editing the same record simultaneously? What happens if a machine crashes during an edit - does the record remain locked? Sandy
 
This answer was given to me by Mr Link9
It was very useful to me..
----------------------------------------
Well, by default, ADO gives you the fastest recordset, which is forwardOnly, readOnly. Many developers will leave it at this, and this really is sufficient for most data operations. I have found that more complicated data operations many times beg for different approaches rather than the recordset.

Problem comes in if and when you need access to certain things, such as recordCount, record locking, updates via recordsets, etc...

Here's a FAQ I wrote on the subject (including the other biggie, lockType). I tried to go into a fair amount of detail w/o getting TOO long winded. Maybe it can help sort things out a bit.

FAQ333-618

Honestly, many times, from reading posts and examples, a budding developer might come to the conclusion that a recordset is the only way to work with data in ASP. This is such a huge misconception. It just pains me to see someone going to great lengths to manipulate data in recordsets when, many times, it's such a simple operation that would be so much better served by either a simple SQL command or a stored procedure.

Keep these types of approaches in mind when you're trying to figure out how to construct your application.

-----------------------------------------------------

Rushi Shroff
 
Rushi,
many thanks for that. it looks exactly like what I was looking for. I'll give you a star for saving long searches through Help etc. Sandy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top