Print Page | Close Window

ASP img tag help!

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Web Design Discussion
Forum Description: Discussion on web design and development subjects.
URL: https://forums.webwiz.net/forum_posts.asp?TID=8288
Printed Date: 29 March 2026 at 12:01pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP img tag help!
Posted By: Necronom
Subject: ASP img tag help!
Date Posted: 22 December 2003 at 3:15pm

Okay, all I'm trying to do is call an asp page for the source of an image, and I can't get it to work on any three of my servers... any help with what I'm messing up would be greatly appreciated

<!-- Begin source of page1.asp -->

<table width="160 height="120" cellpadding="0" cellspacing="0" border="0">
 <tr>
  <td width="160" height="120">
   <img src="page2.asp?ID=1" border="0">
  </td>
 </tr>
</table>

<!-- End source of page1.asp -->

<!-- Begin source of page2.asp -->

<%
strID = Request.Form("ID") 
strAccessDB = "Pics.mdb"
strConnect = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(strAccessDB)
Set ObjConn = Server.CreateObject ("ADODB.Connection")
objConn.Open strConnect
Set objRec = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblImages.* From tblImages WHERE fldID=" & strID & ";"
objRec.Open strSQL, strConnect, 2, 3
strSRC = objRec("fldSRC")
Response.Write(strSRC)
%>

<!-- End source of page2.asp -->

The error I get is simple...the little box with the [COLOR=RED]X[/COLOR] in it. If you just load up the page2.asp file, you are displayed "image.jpg" ; so the db calls are working fine. Also, all SSI's are working fine.

What am I doing wrong?!

. necronom .




Replies:
Posted By: dj air
Date Posted: 24 December 2003 at 7:51am

for starters your requesting.form when it should be request.querystring

Originally posted by Necronom Necronom wrote:

<!-- Begin source of page2.asp -->

<%
strID = Request.Form("ID") 
strAccessDB = "Pics.mdb"
strConnect = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(strAccessDB)
Set ObjConn = Server.CreateObject ("ADODB.Connection")
objConn.Open strConnect
Set objRec = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblImages.* From tblImages WHERE fldID=" & strID & ";"
objRec.Open strSQL, strConnect, 2, 3
strSRC = objRec("fldSRC")
Response.Write(strSRC)
%>

<!-- End source of page2.asp -->

The error I get is simple...the little box with the X in it. If you just load up the page2.asp file, you are displayed "image.jpg" ; so the db calls are working fine. Also, all SSI's are working fine.

What am I doing wrong?!

. necronom .

not sure about this but when creating an image using an .asp command ie image SRC="xx.asp?ID=1" i think in page two you need to set it so thet server knows it is displaying an image...

if you are using wwf (i would think so) .. have a look at the way the security codes are done




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net