Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Root directories and path names.

Status
Not open for further replies.

scroce

MIS
Nov 30, 2000
780
US
could someone offer a coherent explanation of path notation, as in when and how to use ../mydirectory/subdirectory. I keep getting errors like this on my website:


Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

/QuickQuote/QuickQuoteProc.asp, line 59


I know that it's due to incorrect path references, because the asp code runs fine on my personal web server, but as soon as I upload it to my web hosting service, I get a lot of these errors. In this particular case, it's coming from a global.asa file which is trying to access a database. The offending line of code looks like this:

"DefaultDir=c:\inetpub\ & _ "Uid=Admin;Pwd=;"

I realize that this direct path although valid on my local PPC, it won't necessarily work on my hosting provider's server.

What I don't know how to do is properly change it. In the past I've just fooled around with it in order to get it to work right, (by adding ../ or / to a path name) but I never really understood it.

Anyone have a rule of thumb to follow on this? How much water would there be in the ocean if it weren't for sponges?
 
I believe you are trying to setup the directory path to the database...correct? But you don't know what the directory layout on the server is? You can find that out by putting the following in an asp page on the server:


<%= server.mappath(&quot;myPage.asp&quot;)%>

Where myPage.asp is the name of one of the files in the your current folder such as an *.asp, or *.txt file.

Then when you view that page on the web, it will display the directory path of the server upto the folder that the myPage.asp file lays in. I.E. &quot;c:\InetPub\wwwroot\someUser\web\&quot;

Hope this helps!!

-Ovatvvon
 
yes, your assumption is correct - i'm trying to determine the correct path to a database that collects info from a form. The site is on a remote server that I only have access via ftp to upload and download files.

So alls I need to do is upload something like a txt file to the same directory as the database on the hosts site, put a map path statment in some other asp file, then go to that file onthe web and it will show me?

sounds 2 easy. I'll try it and post back. Let me know if I misunderstood you. How much water would there be in the ocean if it weren't for sponges?
 
Yes...but simpler than that...You can just create an .asp file with the mappath in it, and have the mappath use the database for the search. It will give the path to the database. Put the .asp file in the same folder as the database. Then visit it on the web.

Also, don't forget to erase the .asp file afterwards, so no one else can see YOUR path on the server!

hope this all helps.
-Ovatvvon
 
wow, it worked. you're right. That's a really cool shortcut. Thanks! much obliged.

How much water would there be in the ocean if it weren't for sponges?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top