Permission to access database problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

When I try to connect to the database I'm getting the
message that the database file cannot be opened because
"It is already opened exclusively by another user, or you
need permission to view its data."

This appears on the web page since this is how I'm trying
to view data.
I know no-one else has the database open so therefore I
need to set up the database so that permission is allowed
to access data. It's an Access database. How do I go
about doing this?

Thanks in advance
 
I've managed to get past this problem by setting up an
ASP.NET Machine Account for my database. But now I get
the error "Could not lock file" when I run the application.

The database locking mode is set to 1 - but what does that
mean?

No-one is using the database and I've closed it down
before I run the application.

Please help.
 
You need to make sure that the ASPNET account (or the account you are
impersonating) has full access to the directory that contains the Access
data. Whenever you open an Access database, a .ldb file is created. This
contains all of the locking information for the database. If this file
cannot be created, I believe you are not able to open the database.

Jeff
 
Hi Jeff

When I run the application a .ldb file is created but I
can still get the error "Could not lock file".

I am using the server explorer and toolbox data to gain
access to the database(oledbconnection)and the
oledbdataadapter to extract data from the database.
When I write my own code then I can get it to work.
So I don't understand why I get this message when I see
examples in books using this (but for sql server).

Please help if you can.
 
Hi Jeff

I've checked and when I run the application a .ldb file is
created.

I'm using the server explorer and toolbox data to gain
access to the database(oledbconnection) and the
oledbdataadapter to extract data from the database. This
is because the examples I've seen in books using the
equivalent for sqlserver and I'd like to get it to work
for Access.
If I write my own code then I can get it to work.

So why does it not work the other way and what's the best
way of going about this?

Thanks in advance
 
¤ Hi Jeff
¤
¤ I've checked and when I run the application a .ldb file is
¤ created.
¤
¤ I'm using the server explorer and toolbox data to gain
¤ access to the database(oledbconnection) and the
¤ oledbdataadapter to extract data from the database. This
¤ is because the examples I've seen in books using the
¤ equivalent for sqlserver and I'd like to get it to work
¤ for Access.
¤ If I write my own code then I can get it to work.
¤
¤ So why does it not work the other way and what's the best
¤ way of going about this?
¤

Sounds like you still have a permissions issue:

See if the following helps:

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


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