473,503 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6500
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1653
by: Mairhtin O'Feannag | last post by:
I have done a make, and a make install on the 4.3.6 version, using /usr/local/etc/php as the directory I make from. However, no matter what I do, I do not see a php4lib.so that has been created. ...
10
2723
by: Dennis Farr | last post by:
It has been suggested that rather than convert an already large flat file, with many similar rows, to XML, some type of header be attached to the file, containing some sort of meta-XML description...
7
12954
by: A_StClaire_ | last post by:
hi, I'm working on a project spanning five .cpp files. each file was used to define a class. the first has my Main and an #include for each of the other files. problem is my third file...
6
13692
by: Chad Crowder | last post by:
Getting the following error on my production server whether the file exists or not: "System.IO.IOException: Cannot create a file when that file already exists." Here's the code generating the...
9
3680
by: Nathan Sokalski | last post by:
I am recieving an error about not being able to use a file because it is already in use. Based on the error, I think it is referring to my DB, but I don't know how to avoid the error or why it is...
6
10204
by: Don | last post by:
I'm having problems working with a streamwriter object. After closing the streamwriter and setting it to Nothing, I try to delete the file it was writing to, but I always get the following error...
7
13921
by: emanshu | last post by:
HI all, I an designing an application in C++. i want to open file requested by end user but i want to reflect an error to user if file is already opened by some other application.. will anybody...
26
4916
by: Army1987 | last post by:
Is this a good way to check wheter a file already exists? #include <stdio.h> #include <stdlib.h> int ask(const char *prompt); typedef char filename; int main(int argc, char *argv) { FILE...
10
10581
by: David | last post by:
I have googled to no avail on getting specifically what I'm looking for. I have found plenty of full blown apps that implement some type of file transfer but what I'm specifcally looking for is an...
15
5238
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7087
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1514
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.