Relative Pathnames in an ASP program

  • Thread starter Thread starter Ted Polak
  • Start date Start date
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?
 
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
 
Back
Top