Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

The '..' characters are not allowed in the Path parameter for the MapPath method

Posted on 2003-03-06
5
Medium Priority
?
2,194 Views
Last Modified: 2012-06-21
The '..' characters are not allowed in the Path parameter for the MapPath method


objConn.Open "DBQ=" & Server.Mappath("../db.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"


I get that error.. I run my own server so if somebody can say how i can solve that problem (is this an server option?)

thx
0
Comment
Question by:terie
5 Comments
 
LVL 4

Expert Comment

by:mberumen
ID: 8081896
Check out this page,

http://www.montreat.edu/docs/aspdocs/ref/obj/introbj_36.htm
MapPath
The MapPath method maps the specified relative or virtual path to the corresponding physical directory on the server.

Syntax
Server.MapPath( path )

Parameters
path

Specifies the relative or virtual path to map to a physical directory. If path starts with either a forward or backward slash, either (/) or (\), the MapPath method returns a path as if path is a full virtual path. If path doesn’t start with a slash, the MapPath method returns a path relative to the directory of the .asp file being processed.

Note The path parameter can contain relative paths (../../Scripts/, for example) if the EnableParentPath registry setting is set to TRUE. This is the default setting.

0
 

Author Comment

by:terie
ID: 8082582
Note The path parameter can contain relative paths (../../Scripts/, for example) if the EnableParentPath registry setting is set to TRUE. This is the default setting.



where can i find that registry setting? I searched in the register but didn't find anything..
0
 
LVL 4

Accepted Solution

by:
mberumen earned 100 total points
ID: 8083135
That posting probably refers to an older version of IIS,  To change this seeting do the following

Open Internet Services Manager.

Select the node that represents your application or virtual directory,  

right click and select properties

On the first tab look under Application Settings, and click the "Configuration..." Button

On the dialog box that pops up  Go to the "App Options" tab
There is a checkbox labeled "Enable Parent Paths"

Hope this helps




0
 
LVL 4

Expert Comment

by:Wakie
ID: 8085351
Hi terie, you may like to connect to your database via a virtual path like this:

objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\db.mdb"

Regards,
Wakie.
0
 
LVL 28

Expert Comment

by:sybe
ID: 8086638
use this:
Server.Mappath("/") & "../db.mdb;

so:

objConn.Open "DBQ=" & Server.Mappath("/") & "../db.mdb;Driver={Microsoft Access Driver (*.mdb)};"
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

580 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