Solved

Accessing Read-only MDB Files

Posted on 2001-06-24
5
198 Views
Last Modified: 2012-08-13
I am trying the situation wherein a database reads
a mdb file from a CD-ROM (in which case the MDB file property is set as read-only and archive). I need to use ADO to open it but it generates errors (because the file
is read only). How do I get around so my database can
still read files from CD-ROM
0
Comment
Question by:rqs
[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
  • 2
5 Comments
 
LVL 33

Expert Comment

by:hongjun
ID: 6223399
I don't think it is possible. When a mdb file is read, it will create a lock file in the same directory. Since CD is read-only, there will have a problem.

The only way is to copy the file onto local harddisk and then read it. After reading it, delete it.

I will stay here to see more comments and learn from it.

hongjun
0
 
LVL 2

Expert Comment

by:nahumd
ID: 6223530
Even if the mdb is set to read-only on the local hard disk, I still think that you can't open it (although it can write the lock file).
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6223538
You can open it but you can only read cannot update.

hongjun
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6224085
You have to open the MDB for exclusive single user use only. This does not require the .ldb (locking) file to be created.

   Dim con as new ADODB.Connection
   con.Provider = "Microsoft.Jet.Oledb.3.51" ' or jet 4 if required.
   con.Mode = adShareDenyWrite
   con.Open "Data Source=E:\testdb.mdb"

0
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
ID: 6224087
You have to open the MDB for exclusive single user use only. This does not require the .ldb (locking) file to be created.

   Dim con as new ADODB.Connection
   con.Provider = "Microsoft.Jet.Oledb.3.51" ' or jet 4 if required.
   con.Mode = adShareDenyWrite
   con.Open "Data Source=E:\testdb.mdb"

0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 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