Link to home
Start Free TrialLog in
Avatar of sigkappu
sigkappu

asked on

Using Server.MapPath to connect to Database outside of root website folder

I am trying to use Server.MapPath to link to a database located in the folder located at C:/inetpub/wwwroot/internal_genesis/access/Genesis Accounts.mdb  from a page located at C:/indetpub/wwwroot/external_genesis/dologin.asp.  I can not get it to see the database.  What is the syntax that I need to be using to get to that database?

I have tried Server.MapPath("C:/inetpub/wwwroot/internal_genesis/access/Genesis Accounts.mdb") and Server.MapPath("../internal_genesis/access/Genesis Accounts.mdb")

 Thanks for your help
ASKER CERTIFIED SOLUTION
Avatar of sciber_dude
sciber_dude
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sigkappu
sigkappu

ASKER

I'm using this one now:

use this directly... (without Server.MapPath)
"C:/inetpub/wwwroot/internal_genesis/access/Genesis Accounts.mdb"

Thanks
SD
you can do this instead:

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "C:/inetpub/wwwroot/internal_genesis/access/Genesis Accounts.mdb"
%>

It
You are welcome sigkappu! Glad it worked out.

:) SD