kenashton
asked on
Confused Newbie - Server.Mappath() in global.asa
Have 3 web sites (shared IP) with a common /database folder outside the 3 website paths -
c:\websites\MySites\databa se
c:\websites\MySites\mysite 1.com
c:\websites\MySites\mysite 2.com
c:\websites\MySites\mysite 3.com
My original global.asa connection string 'folder' term was
(1) Server.mappath(../database /MyDb.mdb)
This returns the correct absolute path
(2) c:\websites\MySites\databa se\MyDb.md b - - - - - - - SOMETIMES!!!
After two weeks of normal operation, all DB reliant pages stopped working,
investigation showed that the server.mappath function was returning
(3) C:\websites\MySites\mysite 1.com\MySi tes\databa se\MyDb.md b
as if there were a virtual duplicate of the /MySites/database/ part also existing on
.../MySite1 .../MySite2 and .../MySite3 folders.
Temporarily, I have placed the absolute path directly in global.asa. If I put the
original path (1) back in global.asa, everything works for a few days and then stops.
If I catch it at the right moment, a test script definitely reveals that mappath is returning
(3), when things stop working, so I cannot rely upon it.
Bit of a newbie, so I am pretty confused, especially when my test script for mappath
does not return what I expected -
Test 1
(1) Server.mappath(../database /MyDb.mdb)
returns
(2) c:\websites\MySites\databa se\MyDb.md b - SOMETIMES!!!
Test 2
(4) Server.mappath(/database/M yDb.mdb)
returns
(5) C:\websites\MySites\mysite 1.com\MySi tes\databa se\MyDb.md b
Test 3
(6) Server.mappath(/MySites/da tabase/MyD b.mdb)
returns
(7) C:\websites\MySites\mysite 1.com\MySi tes\databa se\MyDb.md b
I am convinced there must be something amiss with my ISP's virtual folder settings. They have been very good, but I think they to are equally perplexed with what is going on.
I hope I have given sufficient info, (5) and (7) really confuse me any help and advice will be
most gratefully appreciated.
Kenny
c:\websites\MySites\databa
c:\websites\MySites\mysite
c:\websites\MySites\mysite
c:\websites\MySites\mysite
My original global.asa connection string 'folder' term was
(1) Server.mappath(../database
This returns the correct absolute path
(2) c:\websites\MySites\databa
After two weeks of normal operation, all DB reliant pages stopped working,
investigation showed that the server.mappath function was returning
(3) C:\websites\MySites\mysite
as if there were a virtual duplicate of the /MySites/database/ part also existing on
.../MySite1 .../MySite2 and .../MySite3 folders.
Temporarily, I have placed the absolute path directly in global.asa. If I put the
original path (1) back in global.asa, everything works for a few days and then stops.
If I catch it at the right moment, a test script definitely reveals that mappath is returning
(3), when things stop working, so I cannot rely upon it.
Bit of a newbie, so I am pretty confused, especially when my test script for mappath
does not return what I expected -
Test 1
(1) Server.mappath(../database
returns
(2) c:\websites\MySites\databa
Test 2
(4) Server.mappath(/database/M
returns
(5) C:\websites\MySites\mysite
Test 3
(6) Server.mappath(/MySites/da
returns
(7) C:\websites\MySites\mysite
I am convinced there must be something amiss with my ISP's virtual folder settings. They have been very good, but I think they to are equally perplexed with what is going on.
I hope I have given sufficient info, (5) and (7) really confuse me any help and advice will be
most gratefully appreciated.
Kenny
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
thanks for accepting and i will look forward to help you in future..
best of luck..
R.K
best of luck..
R.K
ASKER
Thanks for your advice. I am still struggling, but have discovered what is going on, but not why - when server.mappath is in global.asa, it is returning a different path value to when the same statement is 'outside' global.asa, ie on another page, but at the same root folder level as global.asa - when i figure out how to give you the points, will do
Thanks again