Solved

How to locate the path of Access db in ASP?

Posted on 2011-09-19
3
268 Views
Last Modified: 2012-06-27
Dear EE Experts,

We would like to ask for tech support on how to locate the path of our access db that is located on this location (\\10.100.128.149\photo).
In whereas the location of the web is located to another server machine.

Please see the attached code...

Hope to hear soon...
<%
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("\\10.100.128.149\photo\products.mdb")
	Set myConnection = Server.CreateObject("ADODB.Connection")
	Set rsProducts = Server.CreateObject("ADODB.Recordset")
SeriesID = request.QueryString("SeriesID")
myConnection.Open connectString
sqlContent = "SELECT ID, Series, iPhoto, SeriesID, Type, Remarks, iDownload FROM Products WHERE SeriesID ="&Seriesid
Set rsProducts = myConnection.Execute(sqlContent)
%>

Open in new window

0
Comment
Question by:Stiebel Eltron
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 36558654
You can't use "Server.MapPath" because that creates a full path on the local server.  Try it without it.

connectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\10.100.128.149\photo\products.mdb"

You may run into the problem of requiring read/write access to the *.mdb.  It must be located on a 'network file share' with appropriate permissions so you may have to make that a 'mapped drive'.  http://support.microsoft.com/kb/303528
0
 

Author Comment

by:Stiebel Eltron
ID: 36558679
I see, so it's not possible to pull-out from different machine without mapping out the network drive?
0
 

Author Closing Comment

by:Stiebel Eltron
ID: 36558720
Great!
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

776 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