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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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 May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Regular Expressions find/replace needed 10 149
DW UserID Session from Login 1 114
How to use fonts that are .otf file format with Adobe Dreamweaver CC 2015? 12 367
Adobe Indesign CS6 4 165
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…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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