Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-12-22 : 08:33:13
|
Ambrish writes "Hi there!I am using access as my front end and sql as the back end to store the data. My application will have at least 20 concurrent users. I know and i did a lot of reading regarding locking but i am not getting the desired result. SecenarioI have a table Case Notes Type with three stored procedures to add a new case note type, update case note type and retrieve a particular case note type. I have a form in access and when you open the form the list box is loaded with all the case note type in the table. the user has the option to retrieve a particular case note type. Now what i want is that when the user double-clicks in the list box i want to lock the record until he/she clicks the cancel button or changes to different form or clicks the save button. As soon either of the thing happen i want to release the lock, but if they have retrieved the record by double clicking i want the record to be locked. Here is my stored procedure and this is what i am trying to do. I hope any of you guys out there can help me. Thanks in advance.CREATE PROCEDURE dbo.esp_GetCaseNoteType@CaseNotesTypeID intASBegin TranSELECT Type, Description FROM tblCaseNotesType WITH (Rowlock, HoldLock) WHERE CaseNotesTypeID = @CaseNotesTypeID Commit TranGOIf you guys can help me that would be great." |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-12-22 : 08:35:50
|
1. Although this is locking, it is not the same kind of locking that SQL Server performs.2. You will have to write your application to flag the record as uneditable while the user has it open.3. Believe me when I tell youTHIS IS THE WORST FEATURE YOU COULD POSSIBLY HAVE AND IT WILL CAUSE YOU GREAT PAIN AND SUFFERINGIf you don't believe me, wait until 10 people go to lunch and the other 10 need to work on something they have open. Oh yeah, even though you tell them to save and close their work, believe it or not, they don't actually listen. |
 |
|
|
|
|