Link to home
Start Free TrialLog in
Avatar of Stiebel Eltron
Stiebel EltronFlag for Thailand

asked on

How to locate the path of Access db in Map Network Drive location?

Dear EE Experts,

We would like to ask for tech support, this may be related to our previous thread, but here's the case.
We already mapped the network drive where the access db is located, we set it as Drive P:
and inside that drive you'll see the db we need to pull out.
Kindly advise on how to locate it here:
<%
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("products.mdb")
      Set myConnection = Server.CreateObject("ADODB.Connection")
--------------------------------------------------------------------------------------------
The location of the web files is different from the location of the db...
Web files are in Drive K:

If I just use that ("products.mdb"), it will show the old db that is INCLUDED on that web files folder...

Please help...
Avatar of thewild
thewild
Flag of Belgium image

What your are trying to do is very tricky.
Your ASP pages are executed under a special account (probably ASP.NET account, or IUSR_<servername> account). This account does not see mapped drives, these are only seen by real logged on users.
Furthermore, this not will not have, by default, access to the network share.

You could give the user running ASP scripts the right to access this network share, and change Server.MapPath("products.mdb") to "\\<server name>\<share name>\products.mdb". NOT P:\products.mdb, since this user cannot see mapped drives.

You must understand though that giving this IIS user access to a network share is very bad practice security-wise.
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
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 Stiebel Eltron

ASKER

@thewild: sorry but your advise didn't work... I did it already, put the machine name or even its IP, it didn't work...