Print Page | Close Window

IF a database picture field is empty

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=7223
Printed Date: 31 March 2026 at 11:59am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: IF a database picture field is empty
Posted By: mikewatts
Subject: IF a database picture field is empty
Date Posted: 13 November 2003 at 5:35am

I have a news page with text and images inputted into a field from a form.  the trouble is that when i leave the forms blank the page outputs the box with the red cross. (i should add that i want the option to put a max of 5 images on there but when i dont want to use all 5 it comes up with red cross box)

Ive tried this and it doesnt work:

if rsCommon("picURL2")= "" or IsNull(rsCommon("picURL2")) then
    Response.Write "not available"
   else
    response.write("<img align=""left"" CLASS=""IMAGEBORDER"" src=""" & rsCommon("picURL2") & """ border=""0"">")
   end if

when i do this: Response.Write(IsNull(strpicURL2)) it returns False

How do I get this to work?




Replies:
Posted By: Semikolon
Date Posted: 13 November 2003 at 12:46pm

<%
If NOT rsCommon("picURL2") = "" Then
    Response.Write("<img align=""left"" class=""IMAGEBORDER"" src=""" & rsCommon("picURL2")) & """ border=""0"">"
End If
%>



Posted By: mikewatts
Date Posted: 13 November 2003 at 1:42pm

thanks for replying AnthraX

hmmm I actually solved it myself just now but i shall give this a go as less code!

I had to use trim which made it work ok.

thanks for helping a noob!




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