Help with Server.MapPath

Hi guys,

I'm trying to move an Access database to a new server because the old server belongs to another company we're no longer affiliated with.

Database is in my private folder on webserver.


Connection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="Server.MapPath("/private/database/mygreystone.mdb")"

Is this Server.MapPath call right?

Who is Participating?
Usually one would ask for the path of a virtual directory and from there on build the path.

So if your application is running at "http://localhost/mytestweb", it would be

sPath = Server.MapPath("/mytestweb") & "/private/database/mygreystone.mdb")

' connection string would then be
sDSN = "provider=Microsoft.jet.oledb.4.0; data source = " & sPath

'open a connection with the connection string
oConnection.Open sDSN


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.