?
Solved

OleDbConnection and sharing a folder, "Could not lock file."

Posted on 2005-03-30
3
Medium Priority
?
236 Views
Last Modified: 2010-08-05
Hi,

I have a working database connection that I need to share across the network.  But when I share it using Windows Explorer, the connection.Open() call generates an exception.  "Could not lock file."

Any ideas?


Thanks,
Bob

0
Comment
Question by:ba272
[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
  • 2
3 Comments
 

Author Comment

by:ba272
ID: 13667207
Here's what my string looks like:

conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" + @"Data source=" +
"C:\Database.mdb" + ";Mode=Read";
0
 
LVL 6

Accepted Solution

by:
melodiesoflife earned 2000 total points
ID: 13667648
Although you only need to read *.mdb but whenever you open a *.mdb, it will need to lock, so you must have a write permission on it. Please share *.mdb files as write permission.
0
 

Author Comment

by:ba272
ID: 13668483
Oh I see.  The other computer didn't have the requisite write permission so it could create the ldb file.  That's right.

Thanks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 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
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month9 days, 22 hours left to enroll

762 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