Solved

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

Posted on 2004-04-23
3
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LAMP problem identifier tool ? 9 130
question about access to website 2 92
Website URL redirection 10 82
Nameserver and MX Record 2 82
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

737 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