Solved

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

Posted on 2011-09-19
3
336 Views
Last Modified: 2012-05-12
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...
0
Comment
Question by:Stiebel Eltron
3 Comments
 
LVL 4

Expert Comment

by:thewild
ID: 36565324
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.
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 36565327
Try using the full mapped path instead of Server.MapPath.  See Example Code: http://msdn.microsoft.com/en-us/library/ms524632%28v=vs.90%29.aspx to see why it's not working.
0
 

Author Comment

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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now