connecting to a secure Access database

W

wullemsp

I am having problems connecting to an Access database that is secured by an
mdw database.

In Visual Studio using the Server view I am able to connect by setting the
Provider, the database, the system database on the "All" tab, entering the
user and password details and then using the Test Connection. That
succeeds. I also have no difficulty opening the database in Access 2003
SP1.

When I copy the same connectionString to my C# WebService
OleDbConnection.connectionString and then try to open the connection, I get
a message saying " Message @"The Microsoft Jet database engine cannot open
the file 'C:\Acc_Extasy\ExtasyXP_tab.mdb'. It is already opened exclusively
by another user, or you need permission to view its data." string
".

the connection string I am using is :
"Provider=Microsoft.Jet.OLEDB.4.0;User ID=dbowner;Password=blahdiblah;Data
Source=C:\Acc_Extasy\ExtasyXP_tab.mdb;Mode=Share Deny None;Extended
Properties=;Jet OLEDB:System database=C:\Acc_Extasy\ExplorersXP_sys.mdw;Jet
OLEDB:Registry Path=;Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking
Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk
Transactions=1;Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet
OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"


Can anyone tell me what is going on here or point me in the right direction
please.

Paths and filenames are correct, user exist and password, while substituted
here is correct, there are no other connections open.

thanks
 
M

Mythran

Try closing the database in MS Access and try running the application again :)

That is, if you have it open.

Mythran
 
M

Mary Chipman

You might want to try trimming the fat off of the connection string.
You really only need provider name, UID, pwd, name and location of mdw
and mdb. Also, if you're connecting from asp.net, you'll need to set
the appropriate ACLs on the folders and files for ASPNET (the asp.net
worker process), which is what I suspect your problem is in this case.

FWIW, Access/Jet security is pretty much an oxymoron and usually not
worth the effort and aggravation expended on its behalf. It's easily
bypassed by anyone motivated enough to google it. If the mdb is only
being accessed by a web service, then that should be sufficient
protection.

--Mary
 
P

Peter Wullems

Its already closed.

There are no ldb files prior to attempting to open the connection.
 
P

Paul Clement

¤
¤ Its already closed.
¤
¤ There are no ldb files prior to attempting to open the connection.

Yes, but unless you have the appropriate permissions set on the folder an .LDB file cannot be
created, which results in the error you are receiving (and is somewhat misleading).

Check out the link that Val posted. I can almost guarantee you that it's a file system security
related issue.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top