Solved

Handling Locking in MS Access

Posted on 2004-08-16
4
186 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
  • 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now