Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ReadOnly Database Access

Status
Not open for further replies.

svagelis

Programmer
May 2, 2001
121
GR
I want to access a database located in a cd rom. As you can imagine the database file (mdb ) is in readonly mode since its located at the cd rom. I use the following code to establish a connection string


strConnection = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=E:\JSNWind.mdb"

Conn.Open strConnection
Conn.Close

set Conn = Nothing

Its get me an errors says that "The Microsoft Jet database engine cannot open the file 'E:\JSNWind.mdb'. It is already opened exclusively by another user, or you need permission to view its data."

Can you help ??
 
Hi,

This will solve your problem.

Steps:
1. Copy the database (.mdb) to your system
2. Right click on the .mdb file and select properties
3. Remove the check from the read only attribute.
4. Change your connection string to the appropiate
drive\path\filename "Keep Your Code Tight"
 
But i talking about a CD ROM application.All data would be on cd.
 
Hi,

You use a slightly older provider than me. maybe that is the problem, because
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source = c:\tmp\test.mdb"
works fine with an read only database. Just make sure that you do not specify the mode property ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = c:\tmp\test.mdb;mode=write" will fail)
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top