I'm using ADO, at the same time I"m trying to loop through a record set. At this time when I try to test if a Fname, Lname and Zipcode are in the database, by comparing the rs("fname" = ls_fname variable. Here is the code segment that I use, and it seems to fail out. I dunno what I might have done wrong.
-----------------------------
If rsCount(0) <> 0 THEN
rs.movefirst
Do Until rs.EOF
IF (rs("fname" = ls_fname) AND (rs("lname" = ls_lname) AND (rs("zip" = ls_zip) THEN
MSG = "You can only enter the contest once. Thank you."
Exit Do
End If
rs.movenext
Loop
---------------------------------
THe problem is that it never breaks out of the loop. It should if any of the tests proves false. Can anyone see where I"m going wrong?
Thanx,
Donn
-----------------------------
If rsCount(0) <> 0 THEN
rs.movefirst
Do Until rs.EOF
IF (rs("fname" = ls_fname) AND (rs("lname" = ls_lname) AND (rs("zip" = ls_zip) THEN
MSG = "You can only enter the contest once. Thank you."
Exit Do
End If
rs.movenext
Loop
---------------------------------
THe problem is that it never breaks out of the loop. It should if any of the tests proves false. Can anyone see where I"m going wrong?
Thanx,
Donn