File Already In Use

R

rn5a

I am using the following connection to connect to a MS-Access
database:

---------------------------------
set con = server.createObject("adodb.connection")

path1 = server.mappath("./db/MyDB.mdb")

con.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& path1
&";Persist Security Info=False"
---------------------------------

In order to ensure that the admin can write/modify the database, I
have given the IUSR_MachineName Write & Modify permissions to the
Access database but when I do so, ASP generates the following error:

---------------------------------
Microsoft JET Database Engine error '80004005'

Could not use ''; file already in use.

/inc/connection.inc, line 16
---------------------------------

which points to the con.open line shown above.

What's causing this error & how do I resolve it?

Note that if I revoke the Write & Modify permissions, then the above
error doesn't get generated but when the admin tries to insert a new
record, then he is not allowed to do so & the following error gets
generated:

---------------------------------
Microsoft JET Database Engine error '80040e09'

Cannot update. Database or object is read-only.

/inc/global.asp, line 9
 
B

Bob Barrows [MVP]

I am using the following connection to connect to a MS-Access
database:

---------------------------------
set con = server.createObject("adodb.connection")

path1 = server.mappath("./db/MyDB.mdb")

con.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& path1
&";Persist Security Info=False"
---------------------------------

In order to ensure that the admin can write/modify the database, I
have given the IUSR_MachineName Write & Modify permissions to the
Access database but when I do so, ASP generates the following error:

All users of an Access database require Modify permissions for the
_folder_ containing the database. This is to allow the users to create,
modify and delete the ldb file that is used to control multi-user
activity in the database. If Jet does not see an ldb file, it assumes
the database is single-user only.
 
R

rn5a

All users of an Access database require Modify permissions for the
_folder_ containing the database. This is to allow the users to create,
modify and delete the ldb file that is used to control multi-user
activity in the database. If Jet does not see an ldb file, it assumes
the database is single-user only.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.- Hide quoted text -

- Show quoted text -

Thanks Bob for the prompt response. The folder in which the Access DB
file resides does have the Write & Modify permissions but either of
the 2 errors still persist.

Any other suggestion?

RON
 
B

Bob Barrows [MVP]

Thanks Bob for the prompt response. The folder in which the Access DB
file resides does have the Write & Modify permissions but either of
the 2 errors still persist.

Lack of permissions is the only reason for the errors you are getting (esp.
the "already in use" error). You need to properly identify and grant
permissions to the users attempting to open the database. If your site has
Anonymous enabled, then it's the IUSR account that needs those permissions.
Sometimes, depending on the site's isolation property setting, the IWAM
account also needs permission.

If Anonymous is disabled, then it's the actual users that require
permissions.

And don't forget the user that has the database open in Access itself :)
 
B

Bob Barrows [MVP]

randy said:
i have same trouble with database connection and there are 2 error
like that
can you explain again how to resolve it ??
the folder that containing database is not read only
thank you

I don't know what else I can say that would not repeat what I have already
said in this thread.
The only reason for getting those errors is an inability of the users to
createe, modify and delete the .ldb file in the folder containing the
database. It always boils down to lack of permissions. All database users
require Modify (read/write) permissions for the folder containing the
database. I have never seen another cause for this.
As I see it, there are two hurdles:
1. Identifying the database users: if your website has Anonymous access
enabled, then the IUSR_machinename account requires those permissions.
Sometimes, the IWAM_machine account also requires them. If your website is
on a WAN or LAN, and Anonymous is disabled, then the domain users of the
database require permissions.
2. If you are using XP out-of-the-box, then Simple File Sharing is enabled,
preventing you from explicitly granting permissions to the folder to
specific users. You have to disable Simple File Sharing before you will be
able to correctly set the permissions.
http://www.aspfaq.com/show.asp?id=2205

See? I'm repeating myself...
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top