473,322 Members | 1,671 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,322 software developers and data experts.

Cannot Open Access File

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

Similar topics

1
by: Paul | last post by:
Hello, I know there are other messages concerning this error message, but they all look so confusing to me. I have an application that uses an Access database. No problems with permissions....
5
by: Dave | last post by:
This is my first .NET project (although I am experienced with VS6 and InterDev). I am simply trying to set up a basic ASPX project and connect to an Access database (following the instructions in...
3
by: Neal | last post by:
Hi All I am trying to connect from ASP.Net app to an Access Db. If i don't specify a userid an pwd.. I get this error The Microsoft Jet database engine cannot open the file 'C:\Documents and...
2
by: John Donnell | last post by:
We have recently added another PC to the network and have run into difficulty when trying to open access files from the server using the new box. We get the error message 'MS Access cannot open...
2
by: =?Utf-8?B?c25henp5?= | last post by:
I have created an web application using Visual Studio 2008. The application works OK in Debug. However it does not work after publish. The following message appers "The Microsoft Jet database...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.