Relative Pathnames in an ASP program

T

Ted Polak

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?
 
S

szabelin

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 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top