473,725 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1732
supasnail wrote on 02 nov 2006 in microsoft.publi c.inetserver.as p.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*******@gmai l.comwrote in message
news:11******** *************@h 54g2000cwb.goog legroups.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.Writ e 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.publi c.inetserver.as p.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*******@gmai l.comwrote in message
news:11******** *************@h 54g2000cwb.goog legroups.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.Writ e 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.publi c.inetserver.as p.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.publi c.inetserver.as p.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...@gmai l.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.publi c.inetserver.as p.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.publi c.inetserver.as p.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
1772
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 in the correct folder (it worked fine previous to now). I have tested the page on our in house server, which is a Windows 2000 server and the page works fine. I have exported the database data and tables which are necessary to the 2000 server and...
3
4319
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 geographical locations. I have been completely unsucessful in acheiving this goal so far however. Things I have tried: Create a shortcut to ftp sight via browser then tried to map local drive to
2
1414
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 other is an old NT4 domain. These two domains have a trust between them. On a 2003 server I am using the file system object to write a text file to a NT4 web server. The folder on the NT 4 server currently is shared with open
2
2897
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 worker process runs as the local ASP.NET account. When the application is about to access the remote folder I switch the security context to the remote user programmatically, then switch it back afterwards. When I run the application on my local...
2
1122
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 database, then it writes a html table with all pictures as “<img”. So all pictures are displayed near each other. Within the development environment it works (Windows server 2003 with
2
1831
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 replied to an earlier question about this issue, and he informed me that I needed to include my UserID in the "VS Developers" group in order to WebForm apps running under my account capable of accessing \\server\wwwroot$.
1
1494
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 control / use MS Word to create letters using data extracted from an Access database which resides on a webserver. The problem I am having is that I cannot connect to the access database on the web server.
6
3874
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 use laptops. They have Access databases on their laptops and the data is replicated. The idea is that each case worker would scan their own documents, either remotely or back at the office. And NO I am not planning to store the scanned...
2
1800
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 server, and the clients access this app through a shortcut that points to this. The folder of
0
8888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8097
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.