supposed to check for record. simply returns the "not exists" even when record DOES exust dim db, sql_check Set db = Server.CreateObject("ADODB.Connection") db.Open strdbpath sql_check = "select email from newsletter where email =' & inventory & '" Set rs = db.Execute(sql_check) %> <% If rs.eof then response.write ("email not there") else response.write ("email already in db") end if %> Code (markup):
Your code looks ok, are you able to do a response.write of the inventory variable, just to be sure it's using what you expect? Jay
looks like you might not be fully escaping your sql statement to include your "inventory" variable. instead of sql_check = "select email from newsletter where email =' & inventory & '" try sql_check = "select email from newsletter where email ='" & inventory & "'" note the additional double quotes separating the apostropes and the ampersands. hth VG