Print Page | Close Window

Newbie Question - No Record Return Page

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=542
Printed Date: 28 March 2026 at 2:24am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Newbie Question - No Record Return Page
Posted By: jdumayas
Subject: Newbie Question - No Record Return Page
Date Posted: 26 February 2003 at 12:54pm

Hello,  Thanks to all of the help I've been getting in this forum, I've got a better grasp of my SQL queries.  But not I'm having a problem setting up the redirect or "no record found" message.  Here is my code:

If rseComm("offeringID") = False Then


Response.Write ("Sorry Your Query Had No Results")

Else

Response.Write ("<table width=100% border=1 cellspacing=1>")
Response.Write ("<tr><td background=menu-images/menuback.gif><font color=white size=2 face=Arial, Helvetica, sans-serif><strong>Title</a></strong></td><td background=menu-images/menuback.gif><font color=white size=2 face=Arial, Helvetica, sans-serif><strong>Date of Production</td><td background=menu-images/menuback.gif><font color=white size=2 face=Arial, Helvetica, sans-serif><strong>Format</td><td background=menu-images/menuback.gif><font color=white size=2 face=Arial, Helvetica, sans-serif><strong>Duration</td></b><td background=menu-images/menuback.gif><font color=white size=2 face=Arial, Helvetica, sans-serif><strong>Level</td></b></font></tr></font></tr>") 
Do While not rseComm.EOF
    
Response.Write ("<tr bgcolor=FFFFFF>")
Response.Write ("<td><font color=#000000 size=2 face=Arial, Helvetica, sans-serif><a href="&rseComm("offeringLocation")&" target="&rseComm("offeringID")&">"&rseComm("offeringTitle")&"</a></td>"&"<td><font color=#000000 size=2 face=Arial, Helvetica, sans-serif>"&rseComm("dateofProd")&"</td>"&"<td><font color=#000000 size=2 face=Arial, Helvetica, sans-serif>"&rseComm("format")&"</td>"&"<td><font color=#000000 size=2 face=Arial, Helvetica, sans-serif>"&rseComm("duration")&"</font></td>"&"<td><font color=#000000 size=2 face=Arial, Helvetica, sans-serif>"&rseComm("level")&"</font></td>")
Response.Write ("</tr>")
rseComm.MoveNext

Loop

End if

My DB works correctly when there is data to return.  But when there is no data to return I get an error page not liking the "IF" statment line.

I'm not sure if I need to set up another table or another variable.  Any assistance would be greatly appreciated.  Thanks for all of your help. - Jeremy




Replies:
Posted By: MorningZ
Date Posted: 26 February 2003 at 12:55pm
If rseComm.EOF Then
    Response.Write ("Sorry Your Query Had No Results")
Else
blah blah blah
end if



-------------
Contribute to the working anarchy we fondly call the Internet



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