PRB: Cannnot Connect to Access Database from ASP.NET (316675)

P

Patricia Kline

I am not sure if this is the correct forum, however, here is my problem:

I am writing my first web application in dotnet... I have written serveral windows applications in vb.net. I have added a oledb connection, and used the wizard to connect the database. I renamed the connection to cnn. On my page_load, I just have two lines of code:

cnn.open
cnn.close

When i run the problem on my localhost... i get the follow error msg, The Microsoft Jet database enjine cannot open the file 'c:\db1.mdb'. It is alrady opened exclusively by another user, or you do not have permission to view its data.

I found in the knowledge base that a known problem with connecting to an access db with asp.net. It lists several solutions and I have tried them all.

I changed my machine.config processModel userName to "SYSTEM". I added the <identity impersonate = "true" /> to the web.config in my app. And there is no security on the access database. I have no idea what else to do. Can any one help me???
 
O

Oliver

Hi Patricia,

Check to see if there's an .ldb file where the .mdb is located (it might be
hidden). If you find it, delete it. Don't open the database via the file
system - keep Windows Explorer away from the directory.

Don't forget that Access needs to create a locking file, so the ASPNET user
needs read/write and possibly full control on the directory where the .mdb file
is located.

If you are using impersonation make sure you uncheck Anonymous access in IIS
and check Windows Integrated. That forces ASPNET to pass through the
authentication of the browser user.


I am not sure if this is the correct forum, however, here is my problem:

I am writing my first web application in dotnet... I have written serveral
windows applications in vb.net. I have added a oledb connection, and used the
wizard to connect the database. I renamed the connection to cnn. On my
page_load, I just have two lines of code:

cnn.open
cnn.close

When i run the problem on my localhost... i get the follow error msg, The
Microsoft Jet database enjine cannot open the file 'c:\db1.mdb'. It is alrady
opened exclusively by another user, or you do not have permission to view its
data.

I found in the knowledge base that a known problem with connecting to an access
db with asp.net. It lists several solutions and I have tried them all.

I changed my machine.config processModel userName to "SYSTEM". I added the
<identity impersonate = "true" /> to the web.config in my app. And there is no
security on the access database. I have no idea what else to do. Can any one
help me???
 

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

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top