473,698 Members | 2,339 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 1722
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
1770
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
4318
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
1411
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
2894
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
1828
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
1491
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
3866
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
1797
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
8603
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
9157
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
9027
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...
1
8895
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7725
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
6518
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
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2001
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.