473,508 Members | 2,263 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Relative Pathnames in an ASP program

I am trying to use a relative pathname to connect to a Database in a folder
in my wwwroot directory. However, when I test the connection to the
database, I get this error:
'C:\WINNT\system32\Database\CBSWeb.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.
I checked the location of the executing assembly, and it is indeed in
WINNT\system32. I can use Request.PhysicalApplicationPath to find the
proper wwwroot folder. Is there some way to set the ConnectionString with
the proper relative pathname?
Nov 17 '05 #1
1 1276

HttpRequest.MapPath

"Maps the virtual path in the requested URL to a physical
path on the server for the current request"

I'd put relevant files into your web directory, good for
deployment, and no access violations.

-----Original Message-----
I am trying to use a relative pathname to connect to a Database in a folderin my wwwroot directory. However, when I test the connection to thedatabase, I get this error:
'C:\WINNT\system32\Database\CBSWeb.mdb' is not a valid path. Make sure thatthe path name is spelled correctly and that you are connected to the serveron which the file resides.
I checked the location of the executing assembly, and it is indeed inWINNT\system32. I can use Request.PhysicalApplicationPath to find theproper wwwroot folder. Is there some way to set the ConnectionString withthe proper relative pathname?
.

Nov 17 '05 #2

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

Similar topics

7
2822
by: mark | last post by:
I am designing a website at the moment and looking at the difference between relative and absolute url links which is driving me crazy! I would like to use relative paths, but it is proving very...
3
2259
by: Thomas Rademacher | last post by:
Hallo, my application want to scan WIN directories with UNC pathnames. The methods os.path.isdir(pathname) and os.listdir(pathname) work fine with pathname="\\\\servername\\path". But with...
0
1602
by: moxie | last post by:
I am using perl v5.6.1 which I have compiled on a Solaris 8/sparc server using gcc v3.2.2. Building and installing perl was fairly straight forward, save for some noise related to having to...
1
1345
by: draco | last post by:
Hi, Let's say I have a dynamic library libapple.so with a method applemethod() which expects a filename string. I call this method from main() which is in the file foo.c. Now foo.c and apple.so...
18
9423
by: Nak | last post by:
Hi there, Does anyone know what path the AssemblyKeyFile attribute is relative to? For example I currently have mine set to <Assembly: AssemblyKeyFile("..\NicksKey.snk")> Sometimes this...
22
2900
by: Sven-Thorsten Fahrbach | last post by:
Hi Does anybody know of a library that offers a function to split pathnames. It should work somewhat like the following code snippet: ----------------- char *path =...
1
2727
by: dazzler | last post by:
I have used relative path names in my application: for example: logo_image = Image.open("./data/logo.png") everything has worked fine until now... I have compiled my code into exe and made...
12
8567
by: =?ISO-8859-1?Q?Thomas_B=F8rlum?= | last post by:
Hey all, I'm writing a c++ program that needs to read a file. I'm trying to read a file that is in the same directory as the executable. Everything works fine if I execute the program while in...
2
2741
by: Asja | last post by:
Hi, I would like to create a link in my program that will open a file stored in a directory relative to the program itself. e.g. if the program is in the program folder, the file I want to open is...
0
7231
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
7132
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
7336
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,...
1
7063
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
7504
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...
1
5059
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...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
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 ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.