Solved

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

Posted on 2011-09-19
3
333 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 82

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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 …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

760 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

17 Experts available now in Live!

Get 1:1 Help Now