G
Guest
Hi. I've got one of those wierd 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 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 say "IF oldrecord = 5" or "IF newrecord = 5." What am I not
getting? Both variables = 5, but not really? 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 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 say "IF oldrecord = 5" or "IF newrecord = 5." What am I not
getting? Both variables = 5, but not really? Help?