View Full Version : complete ASP newb: want to set correct absolute path

03-27-2007, 05:05 PM
hi all

first off, i know absolutely nothing at all about ASP; i use PHP a little, but I'm mostly a Flash programmer. I've just had to take over a client's site in an emergency and move it across to a new server. the problem is, a particular feature of the site was done in ASP, and an included connection file points to the absolute path of the .mdb database, but obviously with the site being on a new host the path no longer exists:

MM_sos_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\domains\s\site.com\user\htdocs\MapData.mdb"

i checked with the new host, and their faqs state that i should simply use:


however, the new host also talks about setting up a file DSN to properly enable access and... well, at this point I'm completely lost. will i have to recode most of the connection data to establish a connection to the file DSN, or can the original file simply be modified?

please, please help!

03-27-2007, 06:45 PM
For Absolute Paths, you will want to use


Server.MapPath uses the absolute root of your directory, so you can use either

Both should work.

To set up a DSN, you have to have access to the server that the databases is hosted on. Then, use either Control Panel or Administrative Tools to get to ODBC Data Sources. Follow the prompts to create a new DSN to your .MDB file.

In your code, instead of Server.MapPath, you will want to use:

Set conn = Server.CreateObject("ADODB.Connection")
conn.open "DSN=<dsnname>"

That's it.


03-29-2007, 10:57 AM
MM_sos_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("MapData.mdb")

Try this and let me know if it is okay

03-29-2007, 12:51 PM
wow - that did work! thanks for that.

...although it's been so utterly painful, i actually decided it would be easier for me to create a new database in MySQL and script a custom CMS in php rather than go through that particular rigmarole again!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum