Solved

Locked Database

Posted on 1998-06-01
1
167 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how do i create updater to My Activex application? 3 95
centeredAverage challenge 8 179
zeroMAx challenge 20 113
wordmultiple challenge 12 141
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

838 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