Gazthrak
08-14-2006, 01:32 PM
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:
If Lux_Email("Email") <> "" then
The error that comes up is, with no other indication as to what the error is:
error '80020009'
Here is the whole process:
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
I thank you all in advance for any help you can give on the subject.
If Lux_Email("Email") <> "" then
The error that comes up is, with no other indication as to what the error is:
error '80020009'
Here is the whole process:
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
I thank you all in advance for any help you can give on the subject.