Connect to Access Database on CD-ROM

FPM

New member
Joined
Apr 14, 2006
Messages
2
Programming Experience
Beginner
I have a small application that connects to an Access database file. The application only reads from the database so we want to run it from a CD. In VB 6 I could use ReadOnly=1; Exclusive=1 on my connection string and it would work. On VB.net I use Mode=Read but apparently that is not enough and I cannot find an equivalent to the Exclusive parameter. The application runs fine on the hard drive but not on the CD. I get a message "Could not lock the file".

Thanks in advance for your help.

FPM
 
When I try to read the database from the CD ROM, it tries to create the .ldb file. Since that is not possible in the CD ROM, I need to open the database with exclusive access from within the code. I could do that in VB 6, but I have not found a way to do it in .net.

Can you help?

FPM
 
I have no clue what you are talking about. I have made 10+ such projects (Flash and Director plus some third party products - you know multimedia projects) and most of them use Access DB as backend but, i've had never any kind of problem. While you keep your code to only read from the DB it will work just fine trust me!!!
about the .ldb file. Well, whenever you open an Access database, a file with the same name as the database and an extension of LDB will be opened automatically and this new file keeps track of users and the objects that require some form of locking in the database. but, will be never opened if you access it through the frontend.
So if you still get some errors about it then you should check the frontend (maybe it is doing something wrong there).

Regards ;)
 
Last edited:
FPM said:
When I try to read the database from the CD ROM, it tries to create the .ldb file. Since that is not possible in the CD ROM, I need to open the database with exclusive access from within the code. I could do that in VB 6, but I have not found a way to do it in .net.

Can you help?

FPM

Try researching connection strings over at www.connectionstrings.com.
 
Back
Top