Solved

Handling Locking in MS Access

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
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…

830 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