Solved

Accessing Read-only MDB Files

Posted on 2001-06-24
5
177 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now