Solved

Handling Locking in MS Access

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
New to SOAP and need some direction 10 44
XAML: Layout 8 25
Please explain "Multi-Tenant Services" 5 62
SQL Exceptions 3 37
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

912 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

25 Experts available now in Live!

Get 1:1 Help Now