Jul 27, 2008

Using Relative Paths With Mappath

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > .NET ( ASP.net VB.net )

free web hosting

Using Relative Paths With Mappath

kvarnerexpress
I know this is an easy question (if you know the answer…) but I am at the “hair pulling out” stage with this.

Very simply, I have an Access database that I am accessing using ASP (ADO).

If I have the database in the normal htdocs folder and use mappath to tell ASP where it is and what it is called, then no problem. Works perfectly.

However, if I leave the database in that folder and someone “views source” to find out the name of the database, then they can easily download the database. Not good.

I have now put the database in the private folder (same level as htdocs. That is, /private and not /htdocs/private) so that the database cannot be downloaded (correct?).

Problem is I now cannot figure out how to write the mappath so that ASAP can find the database! This is despite searching here, codefixer, w3schools, google etc etc.

I know it’s easy to fix but I just can’t find the answer.

Thanks in advance.

Reply

magiccode9
Did you take a look at the IIS documentation ? if not, take a look of it, you will get more. smile.gif

ok, let's return. If I'am not forget it. You can use .. to return to previous directory.

let's say you have a site path with /htdocs and /private and currently in /htdocs
you have to specific Server.MapPath("../private/[something-to-specific]").

one more to note if your server is disabled "Parent Path". This rule will not be apply. smile.gif

Hope this help

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : relative, paths, mappath

  1. How Would You Treat A Relative That Has Slashed His/Her Wrist
    I would like some suggestions. (19)
  2. Ie6 Relative Positioning Bug
    how to avoid (1)
    i have the following definition in my style and i'd like all elements in site to be relatively
    positioned against their parents so i can position any of them absolute when i need to: CODE
    {     margin:0; padding:0;           font-family:verdana,arial,sans-serif;     
    font-size:11px;      text-align:left;      background:none;      color:black;     
    position:relative;     } All good in opera9 and FF2beta but IE6 stills the page without the
    possibility of scrolling it down. Any ideas?....
  3. Base Tag
    relative or absolute? (2)
    Ive read the w3schools tag description for and i fount that it must be written in this format:
    HTML base href =" http://www.mysite.trap18.com/img/ " /> So what im asking is if this
    href must be absolute or can it be relative like: HTML base href =" /img/ " /> As i did
    not find anything about it on w three skulls nor in google (yet i only visited a few links).
    Absolute links slow down the retrieving of the info right? Thanks! -10730....
  4. Relative Motion Quiz
    can you visualize relative motion? (0)
    I will be so happy when my fiancé is done with this physics course. I’m sick of teaching her
    physics and making up thousands of review questions. Her final is this week though so this should
    be the last time. Any who, thought would post her most recent review sheet since it involves
    relative motion and few real equations. Hopefully it will get a better response since there will be
    less math involved. 1) Bob is standing at the side of the road. Sue is standing in a vehicle.
    Bob measures the vehicle traveling east on the road at a speed of 20m/s. Sue measures a b....

    1. Looking for relative, paths, mappath

Searching Video's for relative, paths, mappath
advertisement



Using Relative Paths With Mappath



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE