I added this code on my page to appear if a recordset is empty:

<% If rsArticles.EOF = False Then %>
                      Sorry, there are no listings for this classification today
  <% End If  %>

I tested the page and that phrase did not appear. There are no records in that field so it should work.

Code at the top:

Dim rsArticles
Dim rsArticles_cmd
Dim rsArticles_numRows

Set rsArticles_cmd = Server.CreateObject ("ADODB.Command")
rsArticles_cmd.ActiveConnection = MM_Classifieds_STRING
rsArticles_cmd.CommandText = "SELECT * FROM Test WHERE CLASS_NUMBER = '44' ORDER BY START_DATE ASC" 
rsArticles_cmd.Prepared = true

Set rsArticles = rsArticles_cmd.Execute
rsArticles_numRows = 0
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rsArticles_numRows = rsArticles_numRows + Repeat1__numRows

Any ideas what the problem could be?

8 Years
Discussion Span
Last Post by chsab420

you dont need to put true or false
it can work this way as well

if(recordset.eof) then 'means recordset is empty

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.