[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2004-04-23
3
Medium Priority
?
263 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 900 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

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
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.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

650 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