PDA

View Full Version : Virtual / Physical Paths...


BucketManXL
03-15-2004, 05:48 AM
How can I change this virtual path to a physical path?

<%
Dim conn, ConnectString

ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("database/db.mdb") & ";Persist Security Info=False"
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnectString
%>

glenngv
03-15-2004, 08:24 AM
You are already doing it when you use Server.MapPath().

BucketManXL
03-15-2004, 05:16 PM
I want to use E:\blah\blah

When I do, I get an error, and it says somthing about physical and virtual paths... I forget what it says

oracleguy
03-15-2004, 07:07 PM
Originally posted by BucketManXL
How can I change this virtual path to a physical path?

<%
Dim conn, ConnectString

ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\blah\blah\db.mdb;Persist Security Info=False"
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnectString
%>

Would be using a physical path.

BucketManXL
03-15-2004, 08:23 PM
Excelente!

Thanks!

whammy
03-16-2004, 01:09 AM
You're better off using a virtual path, however... just keep that in mind.

I tend to avoid using physical paths whenever possible!!!

If you have to change hard drives, etc. then you'll have to update the physical path, whereas you wouldn't have to with the virtual path, as long as the directory structure remains the same.

glenngv
03-16-2004, 03:09 AM
You usually put your db folder, that contains the database, just above the web root directory. See discussion here (http://www.codingforums.com/showthread.php?s=&threadid=33092).

d000hg
03-22-2004, 12:15 AM
My host has the structure:
|
--DB
|
--wwwRoot

But I can't use the path like ..\..\etc because it tells me I'm trying to get beyond the root. If I use the path like "d:\db\..." It tells me I must use a virtual path. How can I fix this please?