server.mappath

  • Thread starter Thread starter Web Search Store
  • Start date Start date
W

Web Search Store

Hello,

I'm trying to use the server.mappath function on a web site hosted on win
2000 professional.

Is this feature not on win 2000 pro?

It simply produces 'page not found'

Thanks for any help

It is in an asp page, with code like this:


countdb="data\searchrequests.txt"
mydsn6= server.mappath(countdb)


Thanks for any help.

Scott Baxter
 
just for a test, try Server.MapPath("./") and see what DIR it returns....
Most likely you are hitting the wrong path.

That command is there in Win2k's IIS.
 
Web said:
Hello,

I'm trying to use the server.mappath function on a web site hosted on
win 2000 professional.

Is this feature not on win 2000 pro?

It simply produces 'page not found'

Thanks for any help

It is in an asp page, with code like this:


countdb="data\searchrequests.txt"
mydsn6= server.mappath(countdb)
server.mappath returns a physical file path (the path you would use in
Windows Explorer, not IE). It should not be used in a situation where a url
is needed ("page not found" results from an invalid url, not an invalid
physical file path). Why don't you show us how you are attempting to use
mydsn6 - that will probably provide the answer to your question.
 
Web Search Store wrote on 08 okt 2005 in
microsoft.public.inetserver.asp.general:
It is in an asp page, with code like this:


countdb="data\searchrequests.txt"
mydsn6= server.mappath(countdb)

While possible, isn't it a bit strange to set a relative path here,
as you probably don't know the current directory
the ASP executable has "in mind".

Better use an absolute path:

countdb="c:\myDir\data\searchrequests.txt"
mydsn6= server.mappath(countdb)
 
Back
Top