472,143 Members | 1,378 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

File Already In Use

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
---------------------------------

Line no. 9 is

objRS.AddNew

Jun 5 '07 #1
5 6424
rn**@rediffmail.com wrote:
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.
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.
Jun 5 '07 #2
On Jun 6, 3:13 am, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
r...@rediffmail.com wrote:
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.

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

Jun 5 '07 #3
rn**@rediffmail.com wrote:
On Jun 6, 3:13 am, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
>r...@rediffmail.com wrote:
>>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.

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.
>- 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.
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 :-)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jun 5 '07 #4

Bob Barrows [MVP] wrote:
*r***@rediffmail.com wrote:
On Jun 6, 3:13 am, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:

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
:-)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so
I
don't check it very often. If you must reply off-line, then remove
the
"NO SPAM" *
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

--
randy thio
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jun 12 '07 #5
randy thio wrote:
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...

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jun 12 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mairhtin O'Feannag | last post: by
10 posts views Thread by Dennis Farr | last post: by
7 posts views Thread by A_StClaire_ | last post: by
9 posts views Thread by Nathan Sokalski | last post: by
7 posts views Thread by emanshu | last post: by
26 posts views Thread by Army1987 | last post: by
10 posts views Thread by David | last post: by
15 posts views Thread by lxyone | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.