Solved

Link Pic From Network Path

Posted on 2007-04-02
10
150 Views
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?
0
Comment
Question by:adraughn
  • 5
  • 5
10 Comments
 
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.
0
 
LVL 13

Author Comment

by:adraughn
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?
0
 
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...
0
 
LVL 13

Author Comment

by:adraughn
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="adovbs.inc"-->
<!--#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")
                  

 else
      
                  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>"
       rs.MoveNext
 
 Loop
 strRes = strRes & "</table>"      
 
 rs.Close
 objConn.Close
 
 Set rs = Nothing
 Set objConn = Nothing


%>
0
 
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.

 
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 13

Author Comment

by:adraughn
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
0
 
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.
0
 
LVL 13

Author Comment

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

\\MyServer\Teardown

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

thanks for your help,

adria
0
 
LVL 70

Accepted Solution

by:
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.

0
 
LVL 13

Author Comment

by:adraughn
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.

adria
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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