Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASP img tag help!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedASP img tag help!

 Post Reply Post Reply
Author
Necronom View Drop Down
Groupie
Groupie


Joined: 19 October 2001
Location: United States
Status: Offline
Points: 116
Direct Link To This Post Topic: ASP img tag help!
    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 .

Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Direct Link To This Post 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

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.