Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > MS Access can't open file

Reply
Thread Tools

MS Access can't open file

 
 
semesm22
Guest
Posts: n/a
 
      12-12-2005
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
 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      12-12-2005
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" <> wrote in message
news:OyN2EF0$...
> 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



 
Reply With Quote
 
 
 
 
semesm22
Guest
Posts: n/a
 
      12-12-2005
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
 
Reply With Quote
 
semesm22
Guest
Posts: n/a
 
      12-12-2005
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
 
Reply With Quote
 
S. Justin Gengo
Guest
Posts: n/a
 
      12-12-2005
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" <> wrote in message
news:utPgeE2$...
>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



 
Reply With Quote
 
semesm22
Guest
Posts: n/a
 
      12-12-2005
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
 
Reply With Quote
 
semesm22
Guest
Posts: n/a
 
      12-13-2005
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
 
Reply With Quote
 
S. Justin Gengo
Guest
Posts: n/a
 
      12-13-2005
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" <> wrote in message
news:%23hYX0p6$...
>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



 
Reply With Quote
 
semesm22
Guest
Posts: n/a
 
      12-13-2005
thanks you very much justin, it works great now...thanks for your help

sam

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
 
Reply With Quote
 
S. Justin Gengo
Guest
Posts: n/a
 
      12-14-2005
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" <> wrote in message
news:...
> thanks you very much justin, it works great now...thanks for your help
>
> sam
>
> --
> Sent via .NET Newsgroups
> http://www.dotnetnewsgroups.com



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program to open a file in binary, skip X bytes and write the rest ofthe file to a new file scad C++ 4 05-28-2009 08:47 AM
Re: how to open a file in some application using Tkinter i am usingTKINTER to create GUI application i want to know how to open a worddocument in open office or any other applicatio Fredrik Lundh Python 1 01-09-2008 10:40 AM
File::open and File.open Brad Tilley Ruby 4 10-24-2006 09:34 PM
Why cannot open .txt file with Encoding = UNICODE using javascript window.open()? ml Java 0 11-30-2004 07:43 AM
How do I open a database connection on an access file that currently open ? THY ASP .Net 4 08-22-2003 03:50 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57