Link Pic From Network Path

Posted on 2007-04-02
Last Modified: 2010-04-25
The db we are pulling from stores only network paths for pictures. Is it possible to display a picture on the page from a network path? How?
Question by:adraughn
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
LVL 70

Expert Comment

by:Jason C. Levine
ID: 18838137
Hi adraughn,

Display them where?  If the network path exists locally and not on the web server, you cannot display the pics by using that path.  You would need to provide some additional scripting to translate the path to the correct web server path.

In order to better answer this we need more information on how your site is set up and what the various paths are.
LVL 13

Author Comment

ID: 18838231
the pictures need to be displayed on the report. i am the programmer that setup the db. i am attempting to help the web guys on resolving this issue.

i created a view that they access to pull in records for the report that they display on the page. they are currently using strSQL = my sql statement to pull in data. i need them to show the pictures for the report as well, BUT i store network paths, not the pictures in the table.

In my front end app, i just create a frame on the form/report and use this code:

Me![ImageFrame_1].Picture = Me![ImagePath_1]

to show the picture from the network path. Is it possible to do something similar in a dreamweaver report?
LVL 70

Expert Comment

by:Jason C. Levine
ID: 18838299
Dreamweaver produces web pages, not reports.  I'm not at all sure what you are trying to do here...
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 13

Author Comment

ID: 18838347
it is a page that is created. they bring in the data via my sql statements and create tables to view the data on the page. here is some code from one of our other reports:
(in this case cnum is the textbox on the page where the user enters the job number or order number.

<%Option Explicit%>
<!--#include file=""-->
<!--#include file="Connect.asp"-->

 Dim objConn
 Dim rs
 Dim strRes
 Dim strSQL

 if request.form("cnum")<>"" then

                  strSQL = "SELECT * FROM vwWEB WHERE JobLogID = " & request.form("cnum")

                  strSQL = "SELECT * FROM vwWEB WHERE JobLogID = 0"
 end if

 Set objConn = Server.CreateObject("ADODB.Connection")
 Set rs = Server.CreateObject("ADODB.Recordset")

 objConn.Open strConnect
 rs.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText
 strRes = "<table border=""0"" width=""400"">"
 Do While Not rs.EOF
 strRes = strRes & "<td>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("JobLogID") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("Customer") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("SpindleType") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("ContactDt") & "</tr><br><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("OrderType") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("MachineSN") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("Status") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("ShipDt") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("ReturnDescrip") & "</tr><br><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("ShipVia") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("TrackingNum") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("FinishedDt") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("PromisDt") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("RecdDt") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("CoreDt") & "</tr><br>"
 strRes = strRes & "<tr><font face=""sans-serif"">" & rs("PromiseDt") & "</tr><br>"
 strRes = strRes & "</td>"
 strRes = strRes & "</table>"      
 Set rs = Nothing
 Set objConn = Nothing

LVL 70

Expert Comment

by:Jason C. Levine
ID: 18838450
What does an image path look like in the DB?

Also, the table code above is screwed up.  There is an opening table tag, then a td tag, THEN a tr tag.  That isn't good.

The loop lines should all look like this:

strRes = strRes & "<tr><td><font face=""sans-serif"">" & rs("JobLogID") & "</td></tr>"

Lose the <td> and </td> lines at the very top and bottom.

LVL 13

Author Comment

ID: 18838554
that wasn't actually the code we finished with. it was some that they sent me during development.

in the db, it looks like this:
\\MyServer\Optimum\Spindle\Spindle_DataBase\Pictures\Linked Pictures\raZweig_1.jpg
LVL 70

Expert Comment

by:Jason C. Levine
ID: 18838629
Do the pictures reside on the web server?  What's the path there?  

My guess is you will have to code a translation from the above path to the correct server path.  Ask your web guys what the correct image path will be.
LVL 13

Author Comment

ID: 18838747
the pictures are not on the web server and my table is updated constantly by users adding reports with pictures. Suggestions?


is the path where all of the pictures should go if theya re to reside on the web server.

thanks for your help,

LVL 70

Accepted Solution

Jason C. Levine earned 500 total points
ID: 18838787
>> Suggestions?

Well, the photos need to be uploaded to the server if this is at all going to work.  I would create a batch file to copy the \\MyServer\Optimum\Spindle\Spindle_DataBase\Pictures\Linked Pictures\ to \\MyServer\Teardown every so often.

You need to know the correct image src tag structure for the web.  Assuming \Teardown is the site root, the correct call would be:

<img src="raZweig_1.jpg">

So you need to write some code that removes \\MyServer\Optimum\Spindle\Spindle_DataBase\Pictures\Linked Pictures\ from the path after the DB returns it.

Better yet, don't store the whole path...just the image file name.

LVL 13

Author Comment

ID: 18838840
i can do that with a sql sp and pull it into the view. so if i do that and create a bat to copy the pics over a few times a day, he will be able to pull the pictures in. (you're my hero)

Keep the lookout for more points, I am sure that my web guys are going to have questions.

thanks again.


Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

687 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