By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 2,082 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

Cannot Open Access File

P: n/a
Using ASP.net 1.1 and Microsoft Access.

I received the following error message. Why? I have closed the Access
file. I have another very small access file that opens with no trouble with
the same code, except a different name for the file.
The Microsoft Jet database engine cannot open the file
'C:\Inetpub\wwwroot\Accident.mdb'. It is already opened exclusively by
another user, or you need permission to view its data.

Jul 9 '07 #1
Share this Question
Share on Google+
24 Replies


P: n/a
First - have you ever been able to open it before, through the web page?
If not - make sure the ASPNet user has 'Change' permissions on the folder
where the Access file resides.

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://iWritePro.com

"dancer" <da****@microsoft.comwrote in message
news:O$*************@TK2MSFTNGP06.phx.gbl...
Using ASP.net 1.1 and Microsoft Access.

I received the following error message. Why? I have closed the Access
file. I have another very small access file that opens with no trouble
with the same code, except a different name for the file.
The Microsoft Jet database engine cannot open the file
'C:\Inetpub\wwwroot\Accident.mdb'. It is already opened exclusively by
another user, or you need permission to view its data.

Jul 9 '07 #2

P: n/a
How do I give 'change' permissions? And why didn't I have to give
persmissions on my other file?
"David Wier" <da*******@davidwier.nospam.comwrote in message
news:eA**************@TK2MSFTNGP05.phx.gbl...
First - have you ever been able to open it before, through the web page?
If not - make sure the ASPNet user has 'Change' permissions on the folder
where the Access file resides.

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://iWritePro.com

"dancer" <da****@microsoft.comwrote in message
news:O$*************@TK2MSFTNGP06.phx.gbl...
>Using ASP.net 1.1 and Microsoft Access.

I received the following error message. Why? I have closed the Access
file. I have another very small access file that opens with no trouble
with the same code, except a different name for the file.
The Microsoft Jet database engine cannot open the file
'C:\Inetpub\wwwroot\Accident.mdb'. It is already opened exclusively by
another user, or you need permission to view its data.


Jul 9 '07 #3

P: n/a
Permissions, permissions permissions.

...

access needs to create a ldb file, which basically is a internal file which
says "userA is logged in" along with other stuff.
but the account which asp.net runs under MUST have permissions to the mdb
file, and to the directory to create/destroy this ldb file.

"dancer" <da****@microsoft.comwrote in message
news:eQ*************@TK2MSFTNGP04.phx.gbl...
How do I give 'change' permissions? And why didn't I have to give
persmissions on my other file?
"David Wier" <da*******@davidwier.nospam.comwrote in message
news:eA**************@TK2MSFTNGP05.phx.gbl...
First - have you ever been able to open it before, through the web page?
If not - make sure the ASPNet user has 'Change' permissions on the
folder
where the Access file resides.

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://iWritePro.com

"dancer" <da****@microsoft.comwrote in message
news:O$*************@TK2MSFTNGP06.phx.gbl...
Using ASP.net 1.1 and Microsoft Access.

I received the following error message. Why? I have closed the Access
file. I have another very small access file that opens with no trouble
with the same code, except a different name for the file.
The Microsoft Jet database engine cannot open the file
'C:\Inetpub\wwwroot\Accident.mdb'. It is already opened exclusively by
another user, or you need permission to view its data.


Jul 9 '07 #4

P: n/a
"dancer" <da****@microsoft.comwrote in message
news:eQ*************@TK2MSFTNGP04.phx.gbl...
How do I give 'change' permissions?
Right-click on the folder, click Properties, Security...
And why didn't I have to give persmissions on my other file?
When using Jet databases you don't just need write permissions on the .mdb
file - you also need write permissions on the folder to allow the Jet engine
to create the locking database (*.ldb) file...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 9 '07 #5

P: n/a
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:uy**************@TK2MSFTNGP04.phx.gbl...
Access97 is a bit quirky for web access.
I'd consider upgrading the database to Access 2000 or Access 2003.
By which, of course, you mean that Jet 3.5 is a bit quirky for web access,
and you'd consider upgrading the database to Jet 4.0 (Access 2000, 2002 and
2003 all use the Jet 4.0 database by default)
Access itself isn't needed on the server. Just the database.
Exactly - just the Jet database is needed on the server...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 9 '07 #6

P: n/a
"When using Jet databases you don't just need write permissions on the .mdb
file - you also need write permissions on the folder to allow the Jet
engine to create the locking database (*.ldb) file..."
Which folder?
>


"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eR**************@TK2MSFTNGP03.phx.gbl...
"dancer" <da****@microsoft.comwrote in message
news:eQ*************@TK2MSFTNGP04.phx.gbl...
>How do I give 'change' permissions?

Right-click on the folder, click Properties, Security...
>And why didn't I have to give persmissions on my other file?

When using Jet databases you don't just need write permissions on the .mdb
file - you also need write permissions on the folder to allow the Jet
engine to create the locking database (*.ldb) file...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 10 '07 #7

P: n/a
I am using Access 2003. I know not what Jet version. I am testing on
local host.
I created another Access file, copied the data, saved it, and it opened just
fine!!! But it probably will happen again.

Now another problem: when I downloaded to my host server and tried to run it
I got the following message.
When I downloaded it, I got the message, "Do you want to change the database
connection?" The first time I said no, the next time I said yes, but
still got the same error message on trying to run it. Any help will be
appreciated.

Could not find file 'c:\windows\system32\inetsrv\Acc.mdb'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Could not find file
'c:\windows\system32\inetsrv\Acc.mdb'.

Source Error:

Line 7: DBConnection = New
OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; " & _
Line 8: "Data Source=Acc.mdb" )
Line 9: DBConnection.Open()
Line 10:
Line 11: Dim DBCommand As OledbCommand

Source File: e:\accounts\whee13\WWW\database_acc_host.aspx Line: 9

Stack Trace:

[OleDbException (0x80004005): Could not find file
'c:\windows\system32\inetsrv\Acc.mdb'.]
System.Data.OleDb.OleDbConnection.ProcessResults(I nt32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
System.Data.OleDb.OleDbConnection.Open() +203
ASP.database_Acc_host_aspx.Page_Load(Object sender, EventArgs e) in
e:\accounts\whee13\WWW\database_acc_host.aspx:9
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uK****************@TK2MSFTNGP06.phx.gbl...
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:uy**************@TK2MSFTNGP04.phx.gbl...
>Access97 is a bit quirky for web access.
I'd consider upgrading the database to Access 2000 or Access 2003.

By which, of course, you mean that Jet 3.5 is a bit quirky for web access,
and you'd consider upgrading the database to Jet 4.0 (Access 2000, 2002
and 2003 all use the Jet 4.0 database by default)
>Access itself isn't needed on the server. Just the database.

Exactly - just the Jet database is needed on the server...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 10 '07 #8

P: n/a
"dancer" <da****@microsoft.comwrote in message
news:uO**************@TK2MSFTNGP02.phx.gbl...
I am using Access 2003.
Have you actually installed a copy of Microsoft Access on your webserver?
Yes or no?
I created another Access file,
No you didn't! You created another Jet database! I know you *think* you're
using Microsoft Access, but you really aren't...
DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; "
See, there's the thing right there. Look at the Provider part of your
connection string - it's using Jet 4...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 10 '07 #9

P: n/a
"dancer" <da****@microsoft.comwrote in message
news:uw**************@TK2MSFTNGP02.phx.gbl...
"When using Jet databases you don't just need write permissions on the
.mdb
>file - you also need write permissions on the folder to allow the Jet
engine to create the locking database (*.ldb) file..."

Which folder?
The folder that your Jet database is in...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 10 '07 #10

P: n/a
"dancer" <da****@microsoft.comwrote in message news:%2****************@TK2MSFTNGP03.phx.gbl...
I did NOT install Microsoft Access.
That's good.
The reason I went to my host server TO install it is because YOU asked,
"Have you actually installed a copy of Microsoft Access on your webserver? Yes or no?"
when I mentioned the error, "Could not find file 'c:\windows\system32\inetsrv\Acc.mdb'"
Do you remember that?
Yes I do.
Why did you ask me that?
Because I wanted to make certain that you *hadn't* installed Microsoft Access on your webserver... :-)
What is your reason as to why I get the above error when trying to run my
file at my host server? Why is it looking for the file on my computer? I
downloaded the acc.mdb file to the host. Nowhere in my code do I refer to
"c:\windows, etc."
Because it can't find the Jet database, so it's looking in the folder it's currently running from instead...
DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data Source=Acc.mdb"
Where *precisely* on your webserver is the Acc.mdb Jet database? Is it in your web app's virtual directory, maybe in the App_Data subfolder...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Jul 10 '07 #11

P: n/a
re:
!DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data Source=Acc.mdb"

That connection assumes the mdb file is located in the c:\windows\system32\inetsrv directory.

An OledbConnection expects a complete physical directory path,
if the path is ,ocated outside the website's directory path :

c:\somepath\someother dir\Acc.mdb

or... a virtual path which can be translated by Server.MapPath.

DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data Source=" & Server.Mappath "/App_Data/Acc.mdb")

Btw, Acc.mdb should *never* be placed anywhere but in the App_Data directory.
As long as the mdb is in the App_Data dir, it cannot be downloaded via a direct link.

Placing it in the root directory of your app allows hackers to download your database.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message news:eV**************@TK2MSFTNGP03.phx.gbl...
"dancer" <da****@microsoft.comwrote in message news:%2****************@TK2MSFTNGP03.phx.gbl...
I did NOT install Microsoft Access.
That's good.
The reason I went to my host server TO install it is because YOU asked,
"Have you actually installed a copy of Microsoft Access on your webserver? Yes or no?"
when I mentioned the error, "Could not find file 'c:\windows\system32\inetsrv\Acc.mdb'"
Do you remember that?
Yes I do.
Why did you ask me that?
Because I wanted to make certain that you *hadn't* installed Microsoft Access on your webserver... :-)
What is your reason as to why I get the above error when trying to run my
file at my host server? Why is it looking for the file on my computer? I
downloaded the acc.mdb file to the host. Nowhere in my code do I refer to
"c:\windows, etc."
Because it can't find the Jet database, so it's looking in the folder it's currently running from instead...
DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data Source=Acc.mdb"
Where *precisely* on your webserver is the Acc.mdb Jet database? Is it in your web app's virtual directory, maybe in the
App_Data subfolder...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Jul 10 '07 #12

P: n/a
Where *precisely* on your webserver is the Acc.mdb Jet database? Is it in your web app's virtual directory, maybe in the App_Data subfolder...?

I tried it in the same place as my aspx file (the root)
I also tried it in the database folder.
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message news:eV**************@TK2MSFTNGP03.phx.gbl...
"dancer" <da****@microsoft.comwrote in message news:%2****************@TK2MSFTNGP03.phx.gbl...
I did NOT install Microsoft Access.
That's good.
The reason I went to my host server TO install it is because YOU asked,
"Have you actually installed a copy of Microsoft Access on your webserver? Yes or no?"
when I mentioned the error, "Could not find file 'c:\windows\system32\inetsrv\Acc.mdb'"
Do you remember that?
Yes I do.
Why did you ask me that?
Because I wanted to make certain that you *hadn't* installed Microsoft Access on your webserver... :-)
What is your reason as to why I get the above error when trying to run my
file at my host server? Why is it looking for the file on my computer? I
downloaded the acc.mdb file to the host. Nowhere in my code do I refer to
"c:\windows, etc."
Because it can't find the Jet database, so it's looking in the folder it's currently running from instead...
DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data Source=Acc.mdb"
Where *precisely* on your webserver is the Acc.mdb Jet database? Is it in your web app's virtual directory, maybe in the App_Data subfolder...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Jul 10 '07 #13

P: n/a
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:O%****************@TK2MSFTNGP02.phx.gbl...
!DBConnection = New
OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data Source=Acc.mdb"

That connection assumes the mdb file is located in the
c:\windows\system32\inetsrv directory.
Indeed.
An OledbConnection expects a complete physical directory path,
if the path is ,ocated outside the website's directory path :
Quite so.
Btw, Acc.mdb should *never* be placed anywhere but in the App_Data
directory.
As long as the mdb is in the App_Data dir, it cannot be downloaded via a
direct link.
Definitely.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 10 '07 #14

P: n/a
See my just-sent reply to this thread.

It has the info you need to solve your problem.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"dancer" <da****@microsoft.comwrote in message news:uX**************@TK2MSFTNGP06.phx.gbl...
Where *precisely* on your webserver is the Acc.mdb Jet database? Is it in your web app's virtual directory, maybe in the
App_Data subfolder...?

I tried it in the same place as my aspx file (the root)
I also tried it in the database folder.
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message news:eV**************@TK2MSFTNGP03.phx.gbl...
"dancer" <da****@microsoft.comwrote in message news:%2****************@TK2MSFTNGP03.phx.gbl...
I did NOT install Microsoft Access.
That's good.
The reason I went to my host server TO install it is because YOU asked,
"Have you actually installed a copy of Microsoft Access on your webserver? Yes or no?"
when I mentioned the error, "Could not find file 'c:\windows\system32\inetsrv\Acc.mdb'"
Do you remember that?
Yes I do.
Why did you ask me that?
Because I wanted to make certain that you *hadn't* installed Microsoft Access on your webserver... :-)
What is your reason as to why I get the above error when trying to run my
file at my host server? Why is it looking for the file on my computer? I
downloaded the acc.mdb file to the host. Nowhere in my code do I refer to
"c:\windows, etc."
Because it can't find the Jet database, so it's looking in the folder it's currently running from instead...
DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data Source=Acc.mdb"
Where *precisely* on your webserver is the Acc.mdb Jet database? Is it in your web app's virtual directory, maybe in
the App_Data subfolder...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Jul 10 '07 #15

P: n/a
Juan,
I tried the path, which did not work.
I tried the physical path, but it is still looking on my c drive instead of
the server.
Here is the error message and the code follows. Can you tell my what is my
problem?

'c:\windows\system32\inetsrv\www.wheelers.com\fpbd \Acc.mdb' is not a valid
path. Make sure that the path name is spelled correctly and that you are
connected to the server on which the file resides.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
'c:\windows\system32\inetsrv\www.wheelers.com\fpbd \Acc.mdb' is not a valid
path. Make sure that the path name is spelled correctly and that you are
connected to the server on which the file resides.

Source Error:

Line 6: Dim DBConnection As OledbConnection
Line 7: DBConnection = New
OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data
Source=www.wheelers.com\fpbd\Acc.mdb")
Line 8: DBConnection.Open()
Line 9:
Line 10: Dim DBCommand As OledbCommand

Source File: e:\accounts\whee13\WWW\database_acc_host.aspx Line: 8

Stack Trace:

[OleDbException (0x80004005):
'c:\windows\system32\inetsrv\www.wheelers.com\fpbd \Acc.mdb' is not a valid
path. Make sure that the path name is spelled correctly and that you are
connected to the server on which the file resides.]
System.Data.OleDb.OleDbConnection.ProcessResults(I nt32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
System.Data.OleDb.OleDbConnection.Open() +203
ASP.database_Acc_host_aspx.Page_Load(Object sender, EventArgs e) in
e:\accounts\whee13\WWW\database_acc_host.aspx:8
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

<%@ Page Language="VB" Debug="true" %>

<%@ Import Namespace="System.Data.Oledb" %>

<script runat="server">

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim DBConnection As OledbConnection

DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data
Source=www.wheelers.com\fpbd\Acc.mdb")

DBConnection.Open()

Dim DBCommand As OledbCommand

DBCommand = New OledbCommand("SELECT * FROM table1, Acc")

Dim SQLString AS String

SQLString = "SELECT * FROM Table1"

DBCommand = New OleDBCommand(SQLString, DBConnection)

Dim DBReader AS OledbDatareader

DBReader = DBCommand.ExecuteReader()
MyDataGrid.DataSource = DBReader

MyDataGrid.DataBind()

DBReader.Close()

DBConnection.Close()

End Sub

</script>

</head>

<body>

<form id="form1" runat="server">

<asp:DataGrid id="MyDataGrid" runat="server"/>

</form>

</body>

</html>


"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:O%****************@TK2MSFTNGP02.phx.gbl...
re:
!DBConnection = New
OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data Source=Acc.mdb"

That connection assumes the mdb file is located in the
c:\windows\system32\inetsrv directory.

An OledbConnection expects a complete physical directory path,
if the path is ,ocated outside the website's directory path :

c:\somepath\someother dir\Acc.mdb

or... a virtual path which can be translated by Server.MapPath.

DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data
Source=" & Server.Mappath "/App_Data/Acc.mdb")

Btw, Acc.mdb should *never* be placed anywhere but in the App_Data
directory.
As long as the mdb is in the App_Data dir, it cannot be downloaded via a
direct link.

Placing it in the root directory of your app allows hackers to download
your database.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eV**************@TK2MSFTNGP03.phx.gbl...
"dancer" <da****@microsoft.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I did NOT install Microsoft Access.

That's good.
>The reason I went to my host server TO install it is because YOU asked,
"Have you actually installed a copy of Microsoft Access on your
webserver? Yes or no?"
when I mentioned the error, "Could not find file
'c:\windows\system32\inetsrv\Acc.mdb'"
Do you remember that?

Yes I do.
>Why did you ask me that?

Because I wanted to make certain that you *hadn't* installed Microsoft
Access on your webserver... :-)
>What is your reason as to why I get the above error when trying to run my
file at my host server? Why is it looking for the file on my computer?
I
downloaded the acc.mdb file to the host. Nowhere in my code do I refer
to
"c:\windows, etc."

Because it can't find the Jet database, so it's looking in the folder it's
currently running from instead...
>DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data
Source=Acc.mdb"

Where *precisely* on your webserver is the Acc.mdb Jet database? Is it in
your web app's virtual directory, maybe in the App_Data subfolder...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 10 '07 #16

P: n/a
re:
!OledbConnection("Provider=Microsoft.Jet.Oledb.4.0 ;Data Source=www.wheelers.com\fpbd\Acc.mdb")

That is not a valid physical path.
What you need to use is Data Source=drive:\somepath\fpbd\Acc.mdb

That will depend on the path to Acc.mdb *on the www.wheelers.com server*.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"dancer" <da****@microsoft.comwrote in message news:eY**************@TK2MSFTNGP02.phx.gbl...
Juan,
I tried the path, which did not work.
I tried the physical path, but it is still looking on my c drive instead of the server.
Here is the error message and the code follows. Can you tell my what is my problem?
'c:\windows\system32\inetsrv\www.wheelers.com\fpbd \Acc.mdb' is not a valid path. Make sure that the path name is
spelled correctly and that you are connected to the server on which the file resides.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack
trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: 'c:\windows\system32\inetsrv\www.wheelers.com\fpbd \Acc.mdb' is
not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which
the file resides.

Source Error:

Line 6: Dim DBConnection As OledbConnection
Line 7: DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data
Source=www.wheelers.com\fpbd\Acc.mdb")
Line 8: DBConnection.Open()
Line 9:
Line 10: Dim DBCommand As OledbCommand

Source File: e:\accounts\whee13\WWW\database_acc_host.aspx Line: 8

Stack Trace:

[OleDbException (0x80004005): 'c:\windows\system32\inetsrv\www.wheelers.com\fpbd \Acc.mdb' is not a valid path. Make
sure that the path name is spelled correctly and that you are connected to the server on which the file resides.]

Jul 10 '07 #17

P: n/a
"dancer" <da****@microsoft.comwrote in message
news:eY**************@TK2MSFTNGP02.phx.gbl...
Data Source=www.wheelers.com\fpbd\Acc.mdb
This is never going to work. See Juan's previous reply - the Data Source
element of the connection string needs to point at a physical file, not a
URL, so:

1) If your web application doesn't already contain an App_Data folder,
create one

2) Place your Acc.mdb database in the App_Data folder

3) Make sure that the account that your web app is running under has write
permissions on the App_Data folder

4) Change your connection string to:
DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data
Source=" & Server.Mappath("~\App_Data\Acc.mdb") & ";"
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 10 '07 #18

P: n/a
How can I know which drive it is on?

"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:e$**************@TK2MSFTNGP05.phx.gbl...
re:
!OledbConnection("Provider=Microsoft.Jet.Oledb.4.0 ;Data
Source=www.wheelers.com\fpbd\Acc.mdb")

That is not a valid physical path.
What you need to use is Data Source=drive:\somepath\fpbd\Acc.mdb

That will depend on the path to Acc.mdb *on the www.wheelers.com server*.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"dancer" <da****@microsoft.comwrote in message
news:eY**************@TK2MSFTNGP02.phx.gbl...
>Juan,
I tried the path, which did not work.
I tried the physical path, but it is still looking on my c drive instead
of the server.
Here is the error message and the code follows. Can you tell my what is
my problem?
>'c:\windows\system32\inetsrv\www.wheelers.com\fpb d\Acc.mdb' is not a
valid path. Make sure that the path name is spelled correctly and that
you are connected to the server on which the file resides.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
'c:\windows\system32\inetsrv\www.wheelers.com\fpb d\Acc.mdb' is not a
valid path. Make sure that the path name is spelled correctly and that
you are connected to the server on which the file resides.

Source Error:

Line 6: Dim DBConnection As OledbConnection
Line 7: DBConnection = New
OledbConnection("Provider=Microsoft.Jet.Oledb.4.0 ;Data
Source=www.wheelers.com\fpbd\Acc.mdb")
Line 8: DBConnection.Open()
Line 9:
Line 10: Dim DBCommand As OledbCommand

Source File: e:\accounts\whee13\WWW\database_acc_host.aspx Line: 8

Stack Trace:

[OleDbException (0x80004005):
'c:\windows\system32\inetsrv\www.wheelers.com\fpb d\Acc.mdb' is not a
valid path. Make sure that the path name is spelled correctly and that
you are connected to the server on which the file resides.]


Jul 10 '07 #19

P: n/a
How do I *Make sure that the account that your web app is running under has
write
permissions on the App_Data folder*?


"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
"dancer" <da****@microsoft.comwrote in message
news:eY**************@TK2MSFTNGP02.phx.gbl...
>Data Source=www.wheelers.com\fpbd\Acc.mdb

This is never going to work. See Juan's previous reply - the Data Source
element of the connection string needs to point at a physical file, not a
URL, so:

1) If your web application doesn't already contain an App_Data folder,
create one

2) Place your Acc.mdb database in the App_Data folder

3) Make sure that the account that your web app is running under has write
permissions on the App_Data folder

4) Change your connection string to:
DBConnection = New OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data
Source=" & Server.Mappath("~\App_Data\Acc.mdb") & ";"
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 10 '07 #20

P: n/a
"dancer" <da****@microsoft.comwrote in message
news:u0**************@TK2MSFTNGP02.phx.gbl...
How can I know which drive it is on?
If you use Server.MapPath, it will evaluate the full path for you...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 10 '07 #21

P: n/a
"dancer" <da****@microsoft.comwrote in message
news:e6**************@TK2MSFTNGP05.phx.gbl...

Dancer,
How do I *Make sure that the account that your web app is running under
has write permissions on the App_Data folder*?
With the greatest of respect, this question has already been answered at
least once already in this thread...

If you are an administrator of the webserver, open up Windows Explorer,
navigate to the folder, right-click on it, click Properties, Security and
give the account that your web app is using write access to the folder.

If this is a remote site e.g. at a 3rd-party ISP, then you will need to
contact them and tell them you need write access to your virtual directory's
App_Data folder...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 10 '07 #22

P: n/a
WITH THE GREATEST OF RESPECT, we have been talking just now about a host
server - which to me is a remote site, and never have "write permissions"
been addressed about a remote site.

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uq**************@TK2MSFTNGP05.phx.gbl...
"dancer" <da****@microsoft.comwrote in message
news:e6**************@TK2MSFTNGP05.phx.gbl...

Dancer,
>How do I *Make sure that the account that your web app is running under
has write permissions on the App_Data folder*?

With the greatest of respect, this question has already been answered at
least once already in this thread...

If you are an administrator of the webserver, open up Windows Explorer,
navigate to the folder, right-click on it, click Properties, Security and
give the account that your web app is using write access to the folder.

If this is a remote site e.g. at a 3rd-party ISP, then you will need to
contact them and tell them you need write access to your virtual
directory's App_Data folder...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 10 '07 #23

P: n/a
"dancer" <da****@microsoft.comwrote in message
news:Ob**************@TK2MSFTNGP05.phx.gbl...
WITH THE GREATEST OF RESPECT, we have been talking just now about a host
server - which to me is a remote site, and never have "write permissions"
been addressed about a remote site.
Sigh... so does your account with your ISP give you have write permissions
on your virtual directory or not...?

You will need to have write permissions on the folder which contains the Jet
database...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 10 '07 #24

P: n/a
YEA!!!!!!!!!!
IT WORKED!!!!!!
THANK YOU!!!!!!
Patience, persistence and perspiration make an unbeatable combination for
success.
- Napolean Hill

"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:e$**************@TK2MSFTNGP05.phx.gbl...
re:
!OledbConnection("Provider=Microsoft.Jet.Oledb.4.0 ;Data
Source=www.wheelers.com\fpbd\Acc.mdb")

That is not a valid physical path.
What you need to use is Data Source=drive:\somepath\fpbd\Acc.mdb

That will depend on the path to Acc.mdb *on the www.wheelers.com server*.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"dancer" <da****@microsoft.comwrote in message
news:eY**************@TK2MSFTNGP02.phx.gbl...
>Juan,
I tried the path, which did not work.
I tried the physical path, but it is still looking on my c drive instead
of the server.
Here is the error message and the code follows. Can you tell my what is
my problem?
>'c:\windows\system32\inetsrv\www.wheelers.com\fpb d\Acc.mdb' is not a
valid path. Make sure that the path name is spelled correctly and that
you are connected to the server on which the file resides.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
'c:\windows\system32\inetsrv\www.wheelers.com\fpb d\Acc.mdb' is not a
valid path. Make sure that the path name is spelled correctly and that
you are connected to the server on which the file resides.

Source Error:

Line 6: Dim DBConnection As OledbConnection
Line 7: DBConnection = New
OledbConnection("Provider=Microsoft.Jet.Oledb.4.0 ;Data
Source=www.wheelers.com\fpbd\Acc.mdb")
Line 8: DBConnection.Open()
Line 9:
Line 10: Dim DBCommand As OledbCommand

Source File: e:\accounts\whee13\WWW\database_acc_host.aspx Line: 8

Stack Trace:

[OleDbException (0x80004005):
'c:\windows\system32\inetsrv\www.wheelers.com\fpb d\Acc.mdb' is not a
valid path. Make sure that the path name is spelled correctly and that
you are connected to the server on which the file resides.]


Jul 11 '07 #25

This discussion thread is closed

Replies have been disabled for this discussion.