MS Access OLEDB connection problem

G

Guest

Hi,

I have an ASP.NET app which opens a MS Access database using the Het 4.0 OleDB provider. My development code abd database live on my D drive. Under .NET's Server Explorer I created a connection to the Access database and used this connection in my OleDBConnection object. When I run the app, all works fine.

I then moved the database to my C drive, created the new connection and used it in my app. When opening the database, the following error is generated...

File xxx.mdb is exclusivly opened by another user or, you do not have permission to view its data.

Anyone have any thoughts.

Mark
 
K

Kevin Spencer

You have a file system permission issue. The user account under which
ASP.Net is running on your machine will need Modify permission for the
folder containing your database.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

RML said:
Hi,

I have an ASP.NET app which opens a MS Access database using the Het 4.0
OleDB provider. My development code abd database live on my D drive. Under
..NET's Server Explorer I created a connection to the Access database and
used this connection in my OleDBConnection object. When I run the app, all
works fine.
I then moved the database to my C drive, created the new connection and
used it in my app. When opening the database, the following error is
generated...
 
K

Ken Cox [Microsoft MVP]

Hi Mark,

That error usually means that the ASPNET account (or whoever it is
impersonating) doesn't have sufficient permissions to write to the directory
where the .mdb file is located.

When you open an Access database - even for reading - Access needs to create
a locking file. When that can't be done, you get the error you've seen.

Let us know?

Ken
Microsoft MVP [ASP.NET]
 
G

Guest

Hi Ken, thanks for the info.

I gave "Everyone" and the "ASPNET" accounts Modify permissions on this mdb file, and now the error "Could not lock file" appears.

No one else is using it, and I can open it in Access with no problems.

Note: The mdb that opens fine (on my D drvie) has "Everyone" with Full Control.

Mark

Ken Cox said:
Hi Mark,

That error usually means that the ASPNET account (or whoever it is
impersonating) doesn't have sufficient permissions to write to the directory
where the .mdb file is located.

When you open an Access database - even for reading - Access needs to create
a locking file. When that can't be done, you get the error you've seen.

Let us know?

Ken
Microsoft MVP [ASP.NET]

RML said:
Hi,

I have an ASP.NET app which opens a MS Access database using the Het 4.0
OleDB provider. My development code abd database live on my D drive.
Under .NET's Server Explorer I created a connection to the Access
database and used this connection in my OleDBConnection object. When I
run the app, all works fine.

I then moved the database to my C drive, created the new connection and
used it in my app. When opening the database, the following error is
generated...

File xxx.mdb is exclusivly opened by another user or, you do not have
permission to view its data.

Anyone have any thoughts.

Mark
 
G

Greg Burns

You need to give modify rights to the folder the .mdb file is in. Access
wants to create/write to the .ldb file in the same directory.

Greg

RML said:
Hi Ken, thanks for the info.

I gave "Everyone" and the "ASPNET" accounts Modify permissions on this mdb
file, and now the error "Could not lock file" appears.
No one else is using it, and I can open it in Access with no problems.

Note: The mdb that opens fine (on my D drvie) has "Everyone" with Full Control.

Mark

Ken Cox said:
Hi Mark,

That error usually means that the ASPNET account (or whoever it is
impersonating) doesn't have sufficient permissions to write to the directory
where the .mdb file is located.

When you open an Access database - even for reading - Access needs to create
a locking file. When that can't be done, you get the error you've seen.

Let us know?

Ken
Microsoft MVP [ASP.NET]

RML said:
Hi,

I have an ASP.NET app which opens a MS Access database using the Het 4.0
OleDB provider. My development code abd database live on my D drive.
Under .NET's Server Explorer I created a connection to the Access
database and used this connection in my OleDBConnection object. When I
run the app, all works fine.

I then moved the database to my C drive, created the new connection and
used it in my app. When opening the database, the following error is
generated...

File xxx.mdb is exclusivly opened by another user or, you do not have
permission to view its data.

Anyone have any thoughts.

Mark
 
K

Ken Cox [Microsoft MVP]

Here are the specific instructions:

PRB: Cannot connect to Access database from ASP.NET

http://support.microsoft.com/default.aspx?scid=kb;en-us;316675

"Grant read and write permissions for the "Everyone" group on the database
and the database folder. This method is not safe; therefore, Microsoft does
not recommend this method."

RML said:
Hi Ken, thanks for the info.

I gave "Everyone" and the "ASPNET" accounts Modify permissions on this mdb
file, and now the error "Could not lock file" appears.

No one else is using it, and I can open it in Access with no problems.

Note: The mdb that opens fine (on my D drvie) has "Everyone" with Full
Control.

Mark

Ken Cox said:
Hi Mark,

That error usually means that the ASPNET account (or whoever it is
impersonating) doesn't have sufficient permissions to write to the
directory
where the .mdb file is located.

When you open an Access database - even for reading - Access needs to
create
a locking file. When that can't be done, you get the error you've seen.

Let us know?

Ken
Microsoft MVP [ASP.NET]

RML said:
Hi,

I have an ASP.NET app which opens a MS Access database using the Het
4.0
OleDB provider. My development code abd database live on my D drive.
Under .NET's Server Explorer I created a connection to the Access
database and used this connection in my OleDBConnection object. When I
run the app, all works fine.

I then moved the database to my C drive, created the new connection and
used it in my app. When opening the database, the following error is
generated...

File xxx.mdb is exclusivly opened by another user or, you do not have
permission to view its data.

Anyone have any thoughts.

Mark
 
G

Guest

Greg, that did the trick. Thanks for the help.

Mark

Greg Burns said:
You need to give modify rights to the folder the .mdb file is in. Access
wants to create/write to the .ldb file in the same directory.

Greg

RML said:
Hi Ken, thanks for the info.

I gave "Everyone" and the "ASPNET" accounts Modify permissions on this mdb
file, and now the error "Could not lock file" appears.
No one else is using it, and I can open it in Access with no problems.

Note: The mdb that opens fine (on my D drvie) has "Everyone" with Full Control.

Mark

Ken Cox said:
Hi Mark,

That error usually means that the ASPNET account (or whoever it is
impersonating) doesn't have sufficient permissions to write to the directory
where the .mdb file is located.

When you open an Access database - even for reading - Access needs to create
a locking file. When that can't be done, you get the error you've seen.

Let us know?

Ken
Microsoft MVP [ASP.NET]

Hi,

I have an ASP.NET app which opens a MS Access database using the Het 4.0
OleDB provider. My development code abd database live on my D drive.
Under .NET's Server Explorer I created a connection to the Access
database and used this connection in my OleDBConnection object. When I
run the app, all works fine.

I then moved the database to my C drive, created the new connection and
used it in my app. When opening the database, the following error is
generated...

File xxx.mdb is exclusivly opened by another user or, you do not have
permission to view its data.

Anyone have any thoughts.

Mark
 

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,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top