Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display a default page when no records are returned

Status
Not open for further replies.

outonalimb

Technical User
Oct 7, 2003
454
GB

Sorry to be a pest in this forum!

How can I display a sentence or a page when no records are found after a database search has taken place?

All I need really to display is 'No records found' and a search again hyperlink.

Regards,
 
Hi,

This is what I use:

In the page that checks for the records insert the following (replace 'rs' with your recordset name):

If rs.eof then
response.redirect ("null.asp?strError=3")
End If

In null.asp I use the following line to write the response.

If strError = "3" Then
Response.Write &quot;<p align=&quot;&quot;center&quot;&quot; class=&quot;&quot;small&quot;&quot;>There are no current reprint orders to be viewed.</p>&quot;
End If

I use a generic page called null that handles all 'record not found' errors.

Hope this helps

ab
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top