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

Home directory in IIS?

Hi,
all stuff works fine if i define absolute paths but with relative i have
some problems:
i defined my at Internet Information Services (IIS) home directory of my
"default web site" and I define in my application all file destinations
relative to this home directory. An example from .aspx file:

<TABLE id="Table1" style="WIDTH: 963px; HEIGHT: 527px" cellSpacing="0"
cellPadding="0" width="963" align="center"
background="pics\background.gif" border="0">

and it works fine. But if I define in web.config path of my database:
<appSettings>
<add
key="connstr"
value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=mdb\database.mdb;"
/>
</appSettings>
and run my application that use this database i get this error message:
Server Error in '/' Application.
----------------------------------------------------------------------------
----
'C:\WINNT\system32\mdb\database.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.
But my home directory defined in IIS is NOT "C:\WINNT\system32\"! My home
directory is some other directory on hard-disc and NOT "C:\WINNT\system32\"!
Whats wrong? Why is application searching for a database relative to
"C:\WINNT\system32\" and not relative to "home directory" defined in IIS?
Please help...

Thanks in advance,

Krunom.

Nov 19 '05 #1
4 1862
When using JET, you must physically specify the full path the to data
source. You can't just imply where the data is.
"Krunom Ancini" <kr****@hotmail.com> wrote in message
news:d0**********@bagan.srce.hr...
Hi,
all stuff works fine if i define absolute paths but with relative i have
some problems:
i defined my at Internet Information Services (IIS) home directory of my
"default web site" and I define in my application all file destinations
relative to this home directory. An example from .aspx file:

<TABLE id="Table1" style="WIDTH: 963px; HEIGHT: 527px" cellSpacing="0"
cellPadding="0" width="963" align="center"
background="pics\background.gif" border="0">

and it works fine. But if I define in web.config path of my database:
<appSettings>
<add
key="connstr"
value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=mdb\database.mdb;"
/>
</appSettings>
and run my application that use this database i get this error message:
Server Error in '/' Application.
----------------------------------------------------------------------------
----
'C:\WINNT\system32\mdb\database.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.
But my home directory defined in IIS is NOT "C:\WINNT\system32\"! My home
directory is some other directory on hard-disc and NOT
"C:\WINNT\system32\"!
Whats wrong? Why is application searching for a database relative to
"C:\WINNT\system32\" and not relative to "home directory" defined in IIS?
Please help...

Thanks in advance,

Krunom.

Nov 19 '05 #2
Hi,
and i have same problem if i place my application at web-host:
application search for a database relative to 'C:\WINNT\system32' and not
relative to root!

Why?
Please help...
Nov 19 '05 #3
Use

<add key="connstr" value="Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=drive:\somepath\subdir\database.mdb;" />

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Krunom Ancini" <kr****@hotmail.com> wrote in message
news:d0**********@bagan.srce.hr...
Hi,
all stuff works fine if i define absolute paths but with relative i have
some problems:
i defined my at Internet Information Services (IIS) home directory of my
"default web site" and I define in my application all file destinations
relative to this home directory. An example from .aspx file:

<TABLE id="Table1" style="WIDTH: 963px; HEIGHT: 527px" cellSpacing="0"
cellPadding="0" width="963" align="center"
background="pics\background.gif" border="0">

and it works fine. But if I define in web.config path of my database:
<appSettings>
<add
key="connstr"
value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=mdb\database.mdb;"
/>
</appSettings>
and run my application that use this database i get this error message:
Server Error in '/' Application.
----------------------------------------------------------------------------
----
'C:\WINNT\system32\mdb\database.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.
But my home directory defined in IIS is NOT "C:\WINNT\system32\"! My home
directory is some other directory on hard-disc and NOT
"C:\WINNT\system32\"!
Whats wrong? Why is application searching for a database relative to
"C:\WINNT\system32\" and not relative to "home directory" defined in IIS?
Please help...

Thanks in advance,

Krunom.

Nov 19 '05 #4
If you don't know the physical path of the database on your web hosting
service, you can use Server.MapPath(...) (for ASP) or Page.MapPath(...) (or
Me.MapPath, for ASP.NET) function to find it.

S. L.

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Use

<add key="connstr" value="Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=drive:\somepath\subdir\database.mdb;" />

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Krunom Ancini" <kr****@hotmail.com> wrote in message
news:d0**********@bagan.srce.hr...
Hi,
all stuff works fine if i define absolute paths but with relative i have
some problems:
i defined my at Internet Information Services (IIS) home directory of my
"default web site" and I define in my application all file destinations
relative to this home directory. An example from .aspx file:

<TABLE id="Table1" style="WIDTH: 963px; HEIGHT: 527px" cellSpacing="0"
cellPadding="0" width="963" align="center"
background="pics\background.gif" border="0">

and it works fine. But if I define in web.config path of my database:
<appSettings>
<add
key="connstr"
value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=mdb\database.mdb;"
/>
</appSettings>
and run my application that use this database i get this error message:
Server Error in '/' Application.
----------------------------------------------------------------------------
----
'C:\WINNT\system32\mdb\database.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.
But my home directory defined in IIS is NOT "C:\WINNT\system32\"! My home
directory is some other directory on hard-disc and NOT
"C:\WINNT\system32\"!
Whats wrong? Why is application searching for a database relative to
"C:\WINNT\system32\" and not relative to "home directory" defined in IIS?
Please help...

Thanks in advance,

Krunom.


Nov 19 '05 #5

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

Similar topics

4
by: Ed | last post by:
Hello All, I posted earlier about a problem I was having with editing or pasting/deleting files in the "Home Directory" of my web server. I just noticed that the "Home Directory" option in the...
4
by: Krunom Ancini | last post by:
Hi, all stuff works fine if i define absolute paths but with relative i have some problems: i defined my at Internet Information Services (IIS) home directory of my "default web site" and I...
6
by: Hemant Shah | last post by:
Folks, I need to move HOME directory of an instance to another directory. What is the best way of doing it? Is changing password file enough? or dies DB2 store this info in it's own config? ...
4
by: jmg3000 | last post by:
What's the customary way to keep your own local Python and package directory? For example, when you're on a server where you don't have root access, and everything must go in your home directory. ...
6
by: lawpoop | last post by:
I'm working on a PHP site and I have my database password file behind the server root directory. I can reference the password file by include("../ database_password.inc.php"), but I would like...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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,...

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.