Solved

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

Posted on 2004-04-23
3
240 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now