PDA

View Full Version : lncluding a file that is in a different folder in the directory


ragol_67
05-16-2006, 07:26 AM
Hi,

I have a members folder and a databases folder in the root directory. In the members folder, I have a datasource file that is suppose to access the database, but I can't figure out how to to a virtual connection. Here is what I have now




<%
strConnect = "Provider={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../databases/imagedb.mdb") & ";"
%>



but that doesn't work.

Could someone please help me out with this issue?


Thanks,
Nick!

handshakeit
05-16-2006, 12:44 PM
Try

<%
strConnect = "Provider={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("~/databases/imagedb.mdb") & ";"
%>

ragol_67
05-20-2006, 11:41 PM
hmm... I tried that, and the server didn't like it. I however did try


<%
strConnect = "Provider={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\databases\imagedb.mdb") & ";"
%>


and it worked!


Thanks,
Nick!