Hi, I am using the following VBScript code within an ASP page. The code is as follows:
<% Do while NOT RS.EOF %>
<% IF RS("Times"
= mytime THEN %>
<% errorForm "Correct. " %>
<% ELSE %>
<% errorForm "Not Correct. " %>
<% END IF %>
<%
RS.MoveNext
Loop
%>
Further above in the page I have connected to the database. Other IF statements are before this and work fine. The mytime variable contains a time that a user enters in a form and this is compared to times held in the database, field name is called Times. I am trying to loop through these times and if the time entered by the user is not equal to any times held in the database then the appropriate message is displayed. However the above code seems only to check the first time in the database table and does not continue through the rest.?
I can't see anything wrong in the code, any ideas?
thanks.
<% Do while NOT RS.EOF %>
<% IF RS("Times"
<% errorForm "Correct. " %>
<% ELSE %>
<% errorForm "Not Correct. " %>
<% END IF %>
<%
RS.MoveNext
Loop
%>
Further above in the page I have connected to the database. Other IF statements are before this and work fine. The mytime variable contains a time that a user enters in a form and this is compared to times held in the database, field name is called Times. I am trying to loop through these times and if the time entered by the user is not equal to any times held in the database then the appropriate message is displayed. However the above code seems only to check the first time in the database table and does not continue through the rest.?
I can't see anything wrong in the code, any ideas?
thanks.