473,407 Members | 2,676 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,407 software developers and data experts.

Problem accessing database from within a folder...

I have a happily working set of asp pages which read from the database
via include file "./_private/include/database.mdb".
However, when I try to gain access to this database on pages one
folder removed using "../_private/include/database.mdb", the pages
won't display. This whole system works fine on my home test server
(iis.5.0), but 'breaks' when uploaded to the public server. I know the
path to database is correct because the upper level pages are
displaying without problem. I am utterly perplexed and any suggestions
would be welcome. I'm using Acess database.

Thank you

Nov 2 '06 #1
8 1700
supasnail wrote on 02 nov 2006 in microsoft.public.inetserver.asp.general:
I have a happily working set of asp pages which read from the database
via include file "./_private/include/database.mdb".
However, when I try to gain access to this database on pages one
folder removed using "../_private/include/database.mdb", the pages
won't display. This whole system works fine on my home test server
(iis.5.0), but 'breaks' when uploaded to the public server. I know the
path to database is correct because the upper level pages are
displaying without problem. I am utterly perplexed and any suggestions
would be welcome. I'm using Acess database.
Use absolute references or server.mapPath() them.

Include files just drop their text content into the calling file,
so the current virtual directory is that of the same calling file.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 2 '06 #2
"supasnail" <su*******@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
>I have a happily working set of asp pages which read from the database
via include file "./_private/include/database.mdb".
However, when I try to gain access to this database on pages one
folder removed using "../_private/include/database.mdb", the pages
won't display. This whole system works fine on my home test server
(iis.5.0), but 'breaks' when uploaded to the public server. I know the
path to database is correct because the upper level pages are
displaying without problem. I am utterly perplexed and any suggestions
would be welcome. I'm using Acess database.

Thank you
Parent paths (using ../../) are enabled by default on IIS5. The default for
IIS6 is that they are not enabled, so this may be the problem if your public
server is windows 2003. If it's your server, you can enable parent paths,
but this is not recommended. If it's not your server, you are unlikely to
persuade your host to enable parent paths. Consequently, you will need to
use a full path in your connection string.

This can be obtained by creating a file called mappath.asp with this
content:

<%Response.Write Server.Mappath("mappath.asp")%>

and placing it in the include folder. Then browse to it.
(www.mydomain/root/_private/include/mappath.asp). It will display the full
path.

--
Mike Brind
Nov 2 '06 #3
I'm not quite sure what you're saying, If I use absolute references on
each page for the database then I would have to change over 30 files
when I upload to the public server after testing, similarly if I use an
absolute path to the include file. Also I am having trouble
understanding why this entire web site functions correctly on my test
server and not on the public server. It only breaks when i attempt to
call the database from pages one directory removed. Have I
misunderstood the advice?

Evertjan. wrote:
supasnail wrote on 02 nov 2006 in microsoft.public.inetserver.asp.general:
I have a happily working set of asp pages which read from the database
via include file "./_private/include/database.mdb".
However, when I try to gain access to this database on pages one
folder removed using "../_private/include/database.mdb", the pages
won't display. This whole system works fine on my home test server
(iis.5.0), but 'breaks' when uploaded to the public server. I know the
path to database is correct because the upper level pages are
displaying without problem. I am utterly perplexed and any suggestions
would be welcome. I'm using Acess database.

Use absolute references or server.mapPath() them.

Include files just drop their text content into the calling file,
so the current virtual directory is that of the same calling file.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 2 '06 #4
ahh, I understand, thank you. I'll give that a go.


Mike Brind wrote:
"supasnail" <su*******@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
I have a happily working set of asp pages which read from the database
via include file "./_private/include/database.mdb".
However, when I try to gain access to this database on pages one
folder removed using "../_private/include/database.mdb", the pages
won't display. This whole system works fine on my home test server
(iis.5.0), but 'breaks' when uploaded to the public server. I know the
path to database is correct because the upper level pages are
displaying without problem. I am utterly perplexed and any suggestions
would be welcome. I'm using Acess database.

Thank you

Parent paths (using ../../) are enabled by default on IIS5. The default for
IIS6 is that they are not enabled, so this may be the problem if your public
server is windows 2003. If it's your server, you can enable parent paths,
but this is not recommended. If it's not your server, you are unlikely to
persuade your host to enable parent paths. Consequently, you will need to
use a full path in your connection string.

This can be obtained by creating a file called mappath.asp with this
content:

<%Response.Write Server.Mappath("mappath.asp")%>

and placing it in the include folder. Then browse to it.
(www.mydomain/root/_private/include/mappath.asp). It will display the full
path.

--
Mike Brind
Nov 2 '06 #5
supasnail wrote on 02 nov 2006 in
microsoft.public.inetserver.asp.general:
Evertjan. wrote:
>supasnail wrote on 02 nov 2006 in
I have a happily working set of asp pages which read from the
database via include file "./_private/include/database.mdb".
However, when I try to gain access to this database on pages one
folder removed using "../_private/include/database.mdb", the pages
won't display. This whole system works fine on my home test server
(iis.5.0), but 'breaks' when uploaded to the public server. I know
the path to database is correct because the upper level pages are
displaying without problem. I am utterly perplexed and any
suggestions would be welcome. I'm using Acess database.

Use absolute references or server.mapPath() them.

Include files just drop their text content into the calling file,
so the current virtual directory is that of the same calling file.
[Please do not toppost on usenet]
I'm not quite sure what you're saying, If I use absolute references on
each page for the database then I would have to change over 30 files
when I upload to the public server after testing, similarly if I use
an absolute path to the include file.
No, not "off" the include file, but address of the database as staed in
the include file cannot be relative to that file, when you plan to call
that file as an include from files in different virtual directories.

So you only change the include file.

[I do not understand what is wrong in correcting 30 files, if you would
have made a mistake in those 30. If you are lazy: editors like Editpadpro
will do that in one move.]
Also I am having trouble
understanding why this entire web site functions correctly on my test
server and not on the public server. It only breaks when i attempt to
call the database from pages one directory removed. Have I
misunderstood the advice?
The whole point of setting up a working site [with serverside code] is
thorough testing and debugging. Perhaps your virtual root directory
[using server.mappath()] is different or whatever. Point is to get it
working.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 2 '06 #6
I must apologise, I made an error in my forst question, perhaps because
my head is spinning from confusion lol. Where I wrote,
"./_private/include/database.mdb", it should have read
"./_private/include/path.asp" the contents of which is and has always
been the absolute path to the database.

I hope now my previous response makes a little more sense and I
apologise again for creating that confusion.

I have been going round in circles trying to understand this problem,
the site works perfectly on my test server.

S

Evertjan. wrote:
supasnail wrote on 02 nov 2006 in
microsoft.public.inetserver.asp.general:
Evertjan. wrote:
supasnail wrote on 02 nov 2006 in

I have a happily working set of asp pages which read from the
database via include file "./_private/include/database.mdb".
However, when I try to gain access to this database on pages one
folder removed using "../_private/include/database.mdb", the pages
won't display. This whole system works fine on my home test server
(iis.5.0), but 'breaks' when uploaded to the public server. I know
the path to database is correct because the upper level pages are
displaying without problem. I am utterly perplexed and any
suggestions would be welcome. I'm using Acess database.

Use absolute references or server.mapPath() them.

Include files just drop their text content into the calling file,
so the current virtual directory is that of the same calling file.

[Please do not toppost on usenet]
I'm not quite sure what you're saying, If I use absolute references on
each page for the database then I would have to change over 30 files
when I upload to the public server after testing, similarly if I use
an absolute path to the include file.

No, not "off" the include file, but address of the database as staed in
the include file cannot be relative to that file, when you plan to call
that file as an include from files in different virtual directories.

So you only change the include file.

[I do not understand what is wrong in correcting 30 files, if you would
have made a mistake in those 30. If you are lazy: editors like Editpadpro
will do that in one move.]
Also I am having trouble
understanding why this entire web site functions correctly on my test
server and not on the public server. It only breaks when i attempt to
call the database from pages one directory removed. Have I
misunderstood the advice?

The whole point of setting up a working site [with serverside code] is
thorough testing and debugging. Perhaps your virtual root directory
[using server.mappath()] is different or whatever. Point is to get it
working.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 2 '06 #7
OK, I have found a solution - I am now using 'include virtual' rather
than 'include file' so i dont have to use ../../ for gaining access to
higher directories.

On Nov 2, 10:31 am, "supasnail" <supasn...@gmail.comwrote:
I must apologise, I made an error in my forst question, perhaps because
my head is spinning from confusion lol. Where I wrote,
"./_private/include/database.mdb", it should have read
"./_private/include/path.asp" the contents of which is and has always
been the absolute path to the database.

I hope now my previous response makes a little more sense and I
apologise again for creating that confusion.

I have been going round in circles trying to understand this problem,
the site works perfectly on my test server.

S

Evertjan. wrote:
supasnail wrote on 02 nov 2006 in
microsoft.public.inetserver.asp.general:
Evertjan. wrote:
>supasnail wrote on 02 nov 2006 in
I have a happily working set of asp pages which read from the
database via include file "./_private/include/database.mdb".
However, when I try to gain access to this database on pages one
folder removed using "../_private/include/database.mdb", the pages
won't display. This whole system works fine on my home test server
(iis.5.0), but 'breaks' when uploaded to the public server. I know
the path to database is correct because the upper level pages are
displaying without problem. I am utterly perplexed and any
suggestions would be welcome. I'm using Acess database.
>Use absolute references or server.mapPath() them.
>Include files just drop their text content into the calling file,
>so the current virtual directory is that of the same calling file.
[Please do not toppost on usenet]
I'm not quite sure what you're saying, If I use absolute references on
each page for the database then I would have to change over 30 files
when I upload to the public server after testing, similarly if I use
an absolute path to the include file.
No, not "off" the include file, but address of the database as staed in
the include file cannot be relative to that file, when you plan to call
that file as an include from files in different virtual directories.
So you only change the include file.
[I do not understand what is wrong in correcting 30 files, if you would
have made a mistake in those 30. If you are lazy: editors like Editpadpro
will do that in one move.]
Also I am having trouble
understanding why this entire web site functions correctly on my test
server and not on the public server. It only breaks when i attempt to
call the database from pages one directory removed. Have I
misunderstood the advice?
The whole point of setting up a working site [with serverside code] is
thorough testing and debugging. Perhaps your virtual root directory
[using server.mappath()] is different or whatever. Point is to get it
working.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 2 '06 #8
supasnail wrote on 02 nov 2006 in microsoft.public.inetserver.asp.general:
OK, I have found a solution - I am now using 'include virtual' rather
than 'include file' so i dont have to use ../../ for gaining access to
higher directories.
Congtrats, but:

[Please do not toppost on usenet]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 2 '06 #9

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

Similar topics

6
by: Graeme Wood | last post by:
I have an ASP page hosted on a windows 2003 server. This page was working fine until Saturday. Now, the server doesn't serve it and gives a 404 page not found error. The file DEFINITELY exists...
3
by: prodirect | last post by:
Hi all, I hope someone can help me. I've recently created a database and wanted to put it up on an ftp sight so that multiple people could access the same tables at the same time from different...
2
by: Brian Cooper | last post by:
I am trying to determine a permission problem trying to write a text file from one web server to another. Here is the situation: We have two domains in place one is Active Directory and the...
2
by: Jon L. Lovesky | last post by:
Hello all, I am attempting to access a remote folder from an asp.net application (all within the same domain). The application is configured for windows authentication in IIS and the asp.net...
2
by: Charl | last post by:
Hello, I’ve got a very strange but big deployment problem. I’ve written an asp.net application with an usercontrol on a webform. The usercontrol reads all picture names out of a mssql...
2
by: Richard Lionheart | last post by:
Hi All, I generated a WebForm and created a Virtual Directory for it IIS. But I got an error message (shown below) saying something like my app lacked appropriate privileges. David Wang...
1
by: Roger Hembury | last post by:
Hi All, Hope you can help / point me in the right direction with a little problem. I have a VB6 created active X dll which is downloaded to the client using <object> </object> so that I can...
6
by: Bob Alston | last post by:
I am looking for others who have built systems to scan documents, index them and then make them accessible from an Access database. My environment is a nonprofit with about 20-25 case workers who...
2
by: =?ISO-8859-1?B?RulybmFz?= | last post by:
Hey all, I have a URGENT problem and I hope someone could help me... scenery: I have a windows app, coded using C# (framework 1.1 - VS2003)... The exe and dlls of the app is are stored in a...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.