Solved

Accessing Read-only MDB Files

Posted on 2001-06-24
5
174 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
Comment Utility
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
Comment Utility
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
Comment Utility
You can open it but you can only read cannot update.

hongjun
0
 
LVL 43

Expert Comment

by:TimCottee
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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

15 Experts available now in Live!

Get 1:1 Help Now