Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Moving the DB out of the wwwroot dir
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Moving the DB out of the wwwroot dir

 Post Reply Post Reply Page  12>
Author
evening_grosbea View Drop Down
Groupie
Groupie


Joined: 17 January 2004
Location: United States
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote evening_grosbea Quote  Post ReplyReply Direct Link To This Post Topic: Moving the DB out of the wwwroot dir
    Posted: 27 January 2004 at 9:43pm

How can I map the database to a dir outside of the wwwroot directory ?


 'Virtual path to database
 strDbPathAndName = Server.MapPath("?")

Thanks in advance

Back to Top
neotrix View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 09 November 2003
Location: Pakistan
Status: Offline
Points: 433
Post Options Post Options   Thanks (0) Thanks(0)   Quote neotrix Quote  Post ReplyReply Direct Link To This Post Posted: 27 January 2004 at 9:51pm

instead of defining the vertual path, define the physical path, and u can host it anywhere. even out side the www rote directory

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 1:17am
The virtual path will look something like "C:\somedir\somedir\mydb.mdb"

Lead me not into temptation... I know the short cut, follow me.
Back to Top
evening_grosbea View Drop Down
Groupie
Groupie


Joined: 17 January 2004
Location: United States
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote evening_grosbea Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 7:40am

DP - I assume you meant to type "physical path"?

Also - How can I find out what drive my site is on with my host.  Do I just contact them, or can this be accomplished using FTP or another method?

Thanks

Back to Top
neotrix View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 09 November 2003
Location: Pakistan
Status: Offline
Points: 433
Post Options Post Options   Thanks (0) Thanks(0)   Quote neotrix Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 8:45am

there are many ways to do it, there must be a file manager in ur CP, most of the file managers show you the physical path.. and there is mod as well

Back to Top
Eftie View Drop Down
Groupie
Groupie


Joined: 17 March 2003
Location: Netherlands
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote Eftie Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 10:15am
And your provider has to allow physical path mapping and/or ../ in the servermappath function, otherwise youre stuck as well
Eftie
Back to Top
snapey View Drop Down
Newbie
Newbie


Joined: 28 July 2002
Location: United Kingdom
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote snapey Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 5:49pm

To find your physical path, enter this in a page

   response.write(server.MapPath("/"))

This will show you the physical path to your root directory.

My hosting company has all web content in a folder called htdocs, and then parallel to this is a folder called private. So whenever I want to access a file in the private area I use something like:

strRootPath = Server.MapPath("/")
strDbPathAndName
=((Left(strRootPath,len(strRootPath)-6)) & "private/wwForum.mdb")

There should be 2 lines above, but the second has wrapped so be sure to enter it all on one line.
I'm no ASP expert, but what this does is a) get the physical path to the root of the web site. Then b) find the length of that path and remove 6 (the number of characters in htdocs) This gives me the physical path to the root of my hosted web space. I can then add on the folder and database name that I am interested in.

Why go to all this trouble? Because I can use the same code on any of my sites, and the physical path may change, but I can always find my databases no matter which site it is, or which folder the asp is running in.

 

Back to Top
evening_grosbea View Drop Down
Groupie
Groupie


Joined: 17 January 2004
Location: United States
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote evening_grosbea Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 7:39pm
Awesome response Snapey - Thanks!
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.