Solved

Handling Locking in MS Access

Posted on 2004-08-16
4
190 Views
Last Modified: 2010-04-15
I have a situation where two different programs may be attempting to access the same MS Access database. Is there any way to account for this condition? I was thinking about maybe putting someting in the catch portion of a try-catch block which would take appropriate action if the database could not be accessed. In other words, if the first attempt to access the database was unsuccessful, there would be a small wait period, then another attempt. This would continue until the operation was successful.

Would this work? How would I do it?

Thanks!

- nhc
0
Comment
Question by:nh_capricorn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 20

Accepted Solution

by:
TheAvenger earned 250 total points
ID: 11810099
Normally there is no problem that 2 or more applications access the same database (even an Access one). Problems may appear only if two users try to change the same record in the same table in the same database. As Access is a little bit "stupid" it may cause you problems if 2 users try to access at the same time some neighbouring records. However you should first make tests and maybe you will never meet a problem or the problem will be so rare that it is not worth the work to check it/recover it.
0
 
LVL 7

Assisted Solution

by:NipNFriar_Tuck
NipNFriar_Tuck earned 250 total points
ID: 11810845
There are different types of locking that can be set up when accessing the database.  If the locking is setup to record level locking then you are less likely to run into issues, where as I believe that by default MS Access is setup to be table locking.  Of course all applications have to be set to the same level of locking otherwise the race condition could still exist.
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 11810880
I think default for Access is record locking. Still not sure....
0
 

Author Comment

by:nh_capricorn
ID: 11873005
Thank you both. I did some simple tests, and didn't discover any real issues. I may, however need to change the way locking is setup at some point. (Hence the reason for the split: both solutions were useful.)

- nhc
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question