473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

MS Access can't open file

hello all, i am using asp.net with IIS on a Windows XP machine to open
an Access database, and i know that this topic has been posted on forums
hundreds of times, but i can't find an answer that works..

here is the problem, i m opening the database with OleDBConnenction and
OleDbCommand...but i get this error:

The Microsoft Jet database engine cannot open the file
'C:\Database\database.mdb'. It is already opened exclusively by another
user, or you need permission to view its data.

HOWEVER, when i put the database in D:\Database, it works just
fine.....i researched the forums to find an answer, i even found a topic
on MSDN, but that related to server based IIS, and not WIN XP, it was
talking about permissions to everyone, which is something not found on
WIN XP....the problem is that i am doing this for a college assignment,
and i need to hand in the database in the same folder that contains my
web forms and web.config and all that.....i tried to use
Server.MapPath("..\Database\Database.mdb"), but that also didn't
work....can anyone help please...

thanks

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 12 '05 #1
9 1485
You need to give the account your website is running as (it could be
IIS_User or ASPNET depending on whether you have an Identity Impersonate tag
in your web.config file or not) read and write permissions to the folder
that your database is in. To do so navigate to that folder, right click on
it and click properties. If you don't see a "Security" tab in the properties
window for that folder you'll need to reveal it (It's hidden by default on
Windows XP). To reveal the security tab in a folder browsing window click
Tools - Folder Options and then click on the "View" tab. at the very bottom
of the Advanced settings list uncheck "Use simple file sharing"

Then when you right click a folder and choose properties you'll see a
"Security" tab where you may set the permissions.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"semesm22" <sa*********@yahoo.com> wrote in message
news:Oy**************@TK2MSFTNGP10.phx.gbl...
hello all, i am using asp.net with IIS on a Windows XP machine to open
an Access database, and i know that this topic has been posted on forums
hundreds of times, but i can't find an answer that works..

here is the problem, i m opening the database with OleDBConnenction and
OleDbCommand...but i get this error:

The Microsoft Jet database engine cannot open the file
'C:\Database\database.mdb'. It is already opened exclusively by another
user, or you need permission to view its data.

HOWEVER, when i put the database in D:\Database, it works just
fine.....i researched the forums to find an answer, i even found a topic
on MSDN, but that related to server based IIS, and not WIN XP, it was
talking about permissions to everyone, which is something not found on
WIN XP....the problem is that i am doing this for a college assignment,
and i need to hand in the database in the same folder that contains my
web forms and web.config and all that.....i tried to use
Server.MapPath("..\Database\Database.mdb"), but that also didn't
work....can anyone help please...

thanks

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Dec 12 '05 #2
thank you very very very much for that great post....i followed the
directions, and it worked great, once again thank you

sam

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 12 '05 #3
i may have spoke too soon.....i was using VB.NET cause its faster to
work with....but when i tried it with ASP.NET, i still had the same
error message......i did the read write user permissions that you spoke
about, for both the folder that the database is in, and the folder that
the Solution file is in....

any ideas

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 12 '05 #4
Sam,

Let's start with what permissions you're setting on the folder. Which
account is your website running as IUSR or ASPNET?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"semesm22" <sa*********@yahoo.com> wrote in message
news:ut**************@TK2MSFTNGP15.phx.gbl...
i may have spoke too soon.....i was using VB.NET cause its faster to
work with....but when i tried it with ASP.NET, i still had the same
error message......i did the read write user permissions that you spoke
about, for both the folder that the database is in, and the folder that
the Solution file is in....

any ideas

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Dec 12 '05 #5
i'm using IUSR...should i creat another...however, this is an
assignment, so the assessor is probably using IUSR

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 12 '05 #6
i did some research, and found out about the ASPNET user account, and i
added that user to the .mdb file, and gave it write permission on the
file....so i can now use an absolute path which
"C:\Inetpub\wwwroot\Cinema\Database\database.m db" ....
however, when i try to use a relative path, such as
"..\Database\database.mdb" i get an error that says

file "'C:\WINDOWS\system32\Database\Database.mdb" not found...why is it
looking inside C:\windows, when i m trying to just go outside the bin
folder that contains the solution's dll file

thanks again
sam

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 13 '05 #7
Sam,

Ok, I understand the problem now. When connecting to an access database you
have to specify the absolute path. But you can get the absolute path from
the relative path by using Server.MapPath("[Relative Path Here]") You should
still just need to give IUSR the permissions. Server.MapPath will return the
absolute path of the file based on the relative path. Do a Response.Write of
Server.MapPath to see what it is returning.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"semesm22" <sa*********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
i did some research, and found out about the ASPNET user account, and i
added that user to the .mdb file, and gave it write permission on the
file....so i can now use an absolute path which
"C:\Inetpub\wwwroot\Cinema\Database\database.m db" ....
however, when i try to use a relative path, such as
"..\Database\database.mdb" i get an error that says

file "'C:\WINDOWS\system32\Database\Database.mdb" not found...why is it
looking inside C:\windows, when i m trying to just go outside the bin
folder that contains the solution's dll file

thanks again
sam

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Dec 13 '05 #8
thanks you very much justin, it works great now...thanks for your help

sam

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 14 '05 #9
Sam,

You're welcome. I'm glad I was able to help!

Happy programming,

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"semesm22" <sa*********@yahoo.com> wrote in message
news:Oa**************@TK2MSFTNGP10.phx.gbl...
thanks you very much justin, it works great now...thanks for your help

sam

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Dec 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
2
by: bbxrider | last post by:
is there no other way to use access(.mdb) across the internet?? (than vpn or worse yet terminal services) i'm trying to write to a mdb on my organization win2k server from my webhost redhat...
10
by: MHenry | last post by:
Hi, We were going merrily along for 6 years using this database to record all client checks that came into our office, including information about what the checks were for. Suddenly, network...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
12
by: Ron Weldy | last post by:
I have a test server runinng 2003/IIS 6 with a mixture of asp and asp.net files. On my workstation I have a share set up to the folder where the web files reside. I am just doing quick and dirty...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
8
by: Shooter4Life8 | last post by:
I am trying to run a macro from my VB.NET program. Here is my code. Dim myAccess As Access.Application Dim allMacro As String = "ALL-Macros" myAccess.DoCmd.RunMacro(allMacro) I get the error....
9
by: O | last post by:
I need to do some lookups and updates on some legacy Access 2.0 files (they've from another vendor and I'm not in a position to update them). I was successful using VB6, but I've moved on to VS...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.