[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

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

Posted on 2005-03-30
3
Medium Priority
?
244 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
  • 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

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.
Suggested Courses
Course of the Month7 days, 20 hours left to enroll

607 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