?
Solved

Locked Database

Posted on 1998-06-01
1
Medium Priority
?
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
tma050898 earned 100 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

649 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