| Author |
Topic Search Topic Options
|
GrlGeek
Newbie
Joined: 10 December 2007
Status: Offline
Points: 7
|
Post Options
Thanks(0)
Quote Reply
Topic: Disallowed Path Characters Posted: 10 December 2007 at 6:04pm |
|
I did a search in the knowledge base, and a search on the forums, but I didn't find the phrase 'Disallowed Path Characters'. I am moving a forum from a server where the admin used the physical path (c:\websites\etc) as the strDbPathAndName to point to the location of the forum database to a hosted server where I need to use the virtual path. The database is an Access database. In the WebWiz Guide, on the 'Securing Your Microsoft Access Database' page (http://www.webwiz.net/webwizforums/kb/moving_access_database.asp), step 4 indicates that I should use ../ to move up the directory tree. However, when I defined the virtual path in database_connection.asp and then attempted to access the forum, I got the error message below:
Server.MapPath() error 'ASP 0175 : 80004005'
Disallowed Path Characters
/forum/database/database_connection.asp, line 87
The '..' characters are not allowed in the Path parameter for the MapPath method.
If I can't use those characters, how do I reference the database outside the root of the website? Or do I have to put the database under the root directory on a hosted server?
Thanks.
|
 |
Jono
Mod Builder Group
Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 December 2007 at 6:22pm |
|
I may be wrong, but do you need to "Enable parent paths" on the web server. If so, in IIS manager, right click the web site, select properties, click the "Home Directory" tab, click the "Configuration" button, then the "Options" tab and place a tick in the "Enable parent paths" check box.
|
 |
Jono
Mod Builder Group
Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 December 2007 at 6:38pm |
Looks like this may be the cause, however, I note you are on a hosted environment, so you may not be able to make the change. The following blog http://www.bennadel.com/blog/153-The-Characters-Are-Not-Allowed-In-The-Path-Parameter-For-The-MapPath-Method.htm also indicates that the command Request.ServerVariables("APPL_PHYSICAL_PATH") may be of use as it gives the physical path.
|
 |
GrlGeek
Newbie
Joined: 10 December 2007
Status: Offline
Points: 7
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 December 2007 at 7:59pm |
|
Thank you very much for your reply! The site is hosted, but it is a virtual dedicated server, so I have an email out to the admin to see if this is a change he can make. In the meantime I will try the Request.ServerVariables command, though if it returns the applications path it will still not be high enough in the tree, since the app is under the site root and the database is outside it.
|
 |
jamie.townsend
Groupie
Joined: 07 December 2007
Location: England
Status: Offline
Points: 114
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 December 2007 at 8:04pm |
Allowing parent paths should fix this and allow you to use ../
The admin should have no problems at all doing this.
However, you really should consider upgrading to SQL as access is poo :D
|
 |
Jono
Mod Builder Group
Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 December 2007 at 8:28pm |
I agree with Jamie.  If you can't use parent paths, you could put the access database in a folder with a random name (perhaps even chaning it's file extension - it should work), so the database become something like "7we!rty5\asd75$r.ahgrt" under your forum folder. The APPL_PHYSICAL_PATH will give you the full path to put in the connection string. It's security by obsecurity - not brilliant, but better than nothing. The web server may not even serve a "ahgrt" type file to a client, even if the type the full path into the browser.
|
 |
GrlGeek
Newbie
Joined: 10 December 2007
Status: Offline
Points: 7
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 December 2007 at 9:15pm |
|
Ha, yes, Access=poo. If I had my druthers the site would be using SQL on Linux, but I'm just a contractor trying to reassemble the pieces my client has left after dissolving a relationship with the person who set the site up. So, if I change the file extension, the database will still work?
|
 |
Jono
Mod Builder Group
Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 December 2007 at 10:39pm |
|
Can't guarantee it, but I can't see any reason why not. I have used DTS packages on SQL 2000 to read access databases with different extensions and as you have to specify the full path including the extension, it should do.
|
 |