File Already In Use

File Already In Use

am 05.06.2007 23:47:57 von 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
---------------------------------

Line no. 9 is

objRS.AddNew

Re: File Already In Use

am 06.06.2007 00:13:17 von reb01501

rn5a@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.

Re: File Already In Use

am 06.06.2007 00:34:21 von rn5a

On Jun 6, 3:13 am, "Bob Barrows [MVP]"
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

Re: File Already In Use

am 06.06.2007 01:26:04 von reb01501

rn5a@rediffmail.com wrote:
> On Jun 6, 3:13 am, "Bob Barrows [MVP]"
> 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"

Re: File Already In Use

am 12.06.2007 05:18:39 von randy thio

Bob Barrows [MVP] wrote:
> *rn5a@rediffmail.com wrote:
> > On Jun 6, 3:13 am, "Bob Barrows [MVP]"
> > wrote:
> [color=darkred]
> >
> > 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
------------------------------------------------------------ ------------

Re: File Already In Use

am 12.06.2007 12:30:36 von reb01501

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"