I'm trying to compare one value in a querystring with values in a recordset and find a matching value. How do I write the If statement for this? Also, do I have to loop through the recordsets?<BR><BR>Thanks
theValue = Request.QueryString("SomeVal")<BR><BR>DO UNTIL Recordset.EOF<BR> IF Recordset("theField") = theValue THEN <BR> blnValueFound = True<BR> EXIT FOR<BR> ELSE<BR> Recordset.MoveNext<BR> END IF<BR>LOOP<BR><BR>If blnValueFound THEN Response.Write ("The value was found in the recordset!")<BR><BR>This is a not a good method from a performance point of view. You might want to consider to use a WHERE statement to find the value from the db. Or check Recordset.GetRows to get the recordset in an array. Then you can loop through the array.