Solved

Locked Database

Posted on 1998-06-01
1
163 Views
Last Modified: 2013-11-20
I have made a tracking sysem that uses a database, occasionally all the programs on different machines will say that the database is locked by a certain computer. Is there a way to catch or test if the database is locked, then unlock it?

Lucidity
0
Comment
Question by:lucidity
1 Comment
 
LVL 3

Accepted Solution

by:
tma050898 earned 50 total points
ID: 1315887
Probably the simples (and least db specific) way would be to try and lock the file for read/write permission with _access. That way, if the file is locked, your call will fail.

BOOL bLocked = (-1 == _access(_T("YourFile"), 6));

Tom

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

919 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

14 Experts available now in Live!

Get 1:1 Help Now