Discussion Locked

Path in Access

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi. Ihave a website at www.myname.com and my access database is called help.mdb. My html pages and database are in the same folder. What is the path so I can write to the database?
This is what I have.
objConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="& Server.MapPath("myname.com/database/help.mdb")

3 replies

by alveden

To use the Server.MapPath(), the path should begin from the web servers root path ( The path after the www.myname.com ).

Example with IIS.
If the root path from you server is defind as "C:\inetpub\wwwroot\", where the first page index.html or default.htm resides. The equivalent of the root path when access from the browser would be the url, "http://www.myname.com/".

Hence if the actual database path is "C:\inetpub\wwwroot\database\help.mdb". The Server.MapPath() should look something like this.

objConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="& Server.MapPath("/database/help.mdb") & ";"

This discussion is closed to new replies.