Help connection MS Access DATABASE TO ASP?

Josh R

New member
Hi. I am trying to connect to an access database with ASP. The way it works is I have the DSN code in one file called incGlobal.asp. I did a virtual include statement in all the pages to include that page to access the database. The code only works on the main level of the page. For example (www.website.com/) or website.com/page1.asp or /page2.asp. But as soon as I go to a a sub folder such as www.website.com/folder1/ or /folder2/ it cant locate the database. Even if i go to www.website.com/folder1/subfolder1/ it can not locate it. Here is the code. Please help. Thanks The database is located in the main folder (example www.website.com/db.mdb)

THANKS

<%
DSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("db.mdb") & ";"
Set con = Server.CreateObject("ADODB.Connection")
con.Open(DSN)
%>
 
Back
Top