www.webdeveloper.com
Results 1 to 2 of 2

Thread: If... statement bringing vauge error ('80020009')

  1. #1
    Join Date
    Dec 2003
    Posts
    54

    Question If... statement bringing vauge error ('80020009')

    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:

    Code:
    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:

    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
    I thank you all in advance for any help you can give on the subject.

  2. #2
    Join Date
    Aug 2006
    Location
    Toronto
    Posts
    104
    I think you should try doing:
    Code:
    If Not Lux_Email.EOF Then
     ...
    If it is not EOF, that means you have something in the RecordSet, also means that you have at least 1 entry that has the same email address.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles