G
Guest
Hi. I've got one of those weird problems like when gravity stops working. It
may be because I have no idea what I'm doing. I am trying to compare a
previously entered value with a value coming from a form. Everything works
fine, but my if then statement (identical to others that do work) isn't
working. Here it is:
<%
dim SqlJunk
SqlJunk = "SELECT * FROM study1 WHERE ID = 652"
Set out = Server.CreateObject("ADODB.Recordset")
out.Open SqlJunk, cnn, 3,3
oldrecord=out("question2")
Response.Write oldrecord
Response.Write newrecord
if oldrecord = newrecord then
message = "It works!"
Response.Write message
end if
%>
So it writes the values 5 and 5; The values for the new record (from the
form) and the old record (from access table) respectively, but then fails to
write the message, despite the fact that the if then condition should be
satisfied. It DOES work as expected if < is used, but not if > is used. It
also works if I substitute a different variable from the form. So oldrecord
=5, but not really? What am I not getting? Help?
may be because I have no idea what I'm doing. I am trying to compare a
previously entered value with a value coming from a form. Everything works
fine, but my if then statement (identical to others that do work) isn't
working. Here it is:
<%
dim SqlJunk
SqlJunk = "SELECT * FROM study1 WHERE ID = 652"
Set out = Server.CreateObject("ADODB.Recordset")
out.Open SqlJunk, cnn, 3,3
oldrecord=out("question2")
Response.Write oldrecord
Response.Write newrecord
if oldrecord = newrecord then
message = "It works!"
Response.Write message
end if
%>
So it writes the values 5 and 5; The values for the new record (from the
form) and the old record (from access table) respectively, but then fails to
write the message, despite the fact that the if then condition should be
satisfied. It DOES work as expected if < is used, but not if > is used. It
also works if I substitute a different variable from the form. So oldrecord
=5, but not really? What am I not getting? Help?