Displaying 'No Records Found'

Results 1 to 2 of 2

Thread: Displaying 'No Records Found'

  1. #1
    Join Date
    Dec 1969

    Default Displaying 'No Records Found'

    I am trying to get the text ‘No Results Found’ displayed when there are none, it works, but the table headings are still displayed underneath. If I move the table headings into the loop, which is carried out where there are records, then the headings are repeated for every record. Any ideas anyone? The code I am using is:<BR><BR>If myRS.EOF then <BR>Response.Write "No Records Found" <BR>End If<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Displaying 'No Records Found'

    You need to stop execution of the code AFTER you write that message.<BR><BR>A simple way is to use Response.End:<BR>If myRS.EOF Then<BR> Response.Write "No Records Found"<BR> Response.End<BR>End If<BR><BR>Or, you can put the code to display the records into an Else statement:<BR>If myRS.EOF Then<BR> Response.Write "No Records Found"<BR>Else<BR> &#039;current display code<BR>End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts