Forums
This topic is locked
Is there a way to locate your folder in a webserve
Posted 21 Dec 2003 23:57:03
1
has voted
21 Dec 2003 23:57:03 Turo Jokinen posted:
Hello Everyone!Is there a way to locate your folder in a webserver? I need to know the directory structure so I can put up an OLE DB connection.
Thanx
Tursas
Replies
Replied 22 Dec 2003 06:27:34
22 Dec 2003 06:27:34 Mike Mr. replied:
If you use the server.mappath command in your connection string, you don't need to know most of the folder on the host. Here is an example for an access database. If you need more examples, just type mappath in the help search file.
"Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath
("/jsmith/data/statistics.mdb"
What it does is tells the server to map out the path up to where your web folder is. The above command replaces this example.
Driver={Microsoft Access Driver (*.mdb)};
DBQ=c:\Inetpub\wwwroot\accounts\users\jsmith\data\statistics.mdb
Mike
"Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath
("/jsmith/data/statistics.mdb"

What it does is tells the server to map out the path up to where your web folder is. The above command replaces this example.
Driver={Microsoft Access Driver (*.mdb)};
DBQ=c:\Inetpub\wwwroot\accounts\users\jsmith\data\statistics.mdb
Mike