Solved

Confused Newbie - Server.Mappath() in global.asa

Posted on 2004-04-23
3
249 Views
Last Modified: 2010-04-20
Have 3 web sites (shared IP) with a common  /database folder outside the 3 website paths -

c:\websites\MySites\database
c:\websites\MySites\mysite1.com
c:\websites\MySites\mysite2.com
c:\websites\MySites\mysite3.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\database\MyDb.mdb     - - - - - - -     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\mysite1.com\MySites\database\MyDb.mdb

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\database\MyDb.mdb - SOMETIMES!!!

Test 2
(4)  Server.mappath(/database/MyDb.mdb)
returns
(5)  C:\websites\MySites\mysite1.com\MySites\database\MyDb.mdb  

Test 3
(6)  Server.mappath(/MySites/database/MyDb.mdb)
returns
(7) C:\websites\MySites\mysite1.com\MySites\database\MyDb.mdb

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
0
Comment
Question by:kenashton
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 300 total points
ID: 10923926
0
 

Author Comment

by:kenashton
ID: 10967029
Hi rama

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
0
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10967060
thanks for accepting and i will look forward to help you in future..
best of luck..

R.K
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question