I am trying to search through a mSQL database for duplicate email addresses. My logic is that if the email being entered is returned in the search, then it is a dupe and will go return an error. If not, then it enters the information. The error is with this line:
The error that comes up is, with no other indication as to what the error is:Code:If Lux_Email("Email") <> "" then
error '80020009'
Here is the whole process:
I thank you all in advance for any help you can give on the subject.Code:Set Lux_Email = Server.CreateObject("ADODB.Recordset") SQL = "SELECT EmailAddress AS Email" SQL = SQL & " FROM Lux_Sweep" SQL = SQL & " WHERE EmailAddress = '" & email & "'" Lux_Email.Open SQL, sConn If Lux_Email("Email") <> "" then Set Lux_Email = nothing Response.redirect("entry.asp?entered=dupe") Else Set lux_sweep=server.createObject("ADODB.Recordset") SQL = "INSERT INTO Lux_Sweep (FName,LName,Address1,Address2,City,State,EmailAddress,Optin,Referer,EntryDate,HasWon,DateWon)" SQL = SQL & "VALUES (" SQL = SQL & " '" & fname & "'," SQL = SQL & " '" & lname & "'," SQL = SQL & " '" & address1 & "'," SQL = SQL & " '" & address2 & "'," SQL = SQL & " '" & city & "'," SQL = SQL & " '" & state & "'," SQL = SQL & " '" & email & "'," SQL = SQL & " '" & optin & "'," SQL = SQL & " '" & referer & "'," SQL = SQL & " '" & today & "'," SQL = SQL & " 'NO'," SQL = SQL & " '')" lux_sweep.Open SQL, sConn Set lux_sweep = nothing Response.redirect("entry.asp?entered=yes") End If


Reply With Quote
Bookmarks