Avatar of ict-torquilclark
 asked on

Run Time Error "Cleaner SP does not exist"

I am using ADODB>Recordset to add a new record to a SQL table and am getting the error in the title when executing rs.update

Can anybody see what i am doing wrong?
Dim CheckInfo As Boolean
    CheckInfo = True

    If comboboxLeadSource.Text = "" Then
        comboboxLeadSource.BackColor = &H80FFFF
        CheckInfo = False
    End If
    If textboxRetirementDate.Text = "__/__/____" Then
    If checkboxAlreadyRetired.Value = Unchecked Then
        textboxRetirementDate.BackColor = &H80FFFF
        CheckInfo = False
    End If
    End If
    If textboxDOB.Text = "__/__/____" Then
        textboxDOB.BackColor = &H80FFFF
        CheckInfo = False
    End If
    If textboxPhoneNumber.Text = "" Then
        textboxPhoneNumber.BackColor = &H80FFFF
        CheckInfo = False
    End If
    If CheckInfo = False Then
        MsgBox ("Please ensure all required fields are entered")
        Exit Sub
    End If
    Dim rs As New ADODB.Recordset
    Dim rs2 As New ADODB.Recordset
    Dim sqlstr As String
    sqlstr = "SELECT TOP 1 * FROM WebEnquiries WHERE WebEnquiryID = 0"
    rs.Open sqlstr, SQLCnn, adOpenStatic, adLockOptimistic
    sqlstr = "SELECT SourceID FROM Sources WHERE SourceLiteral = '" & comboboxLeadSource.Text & "'"
    rs2.Open sqlstr, SQLCnn, adOpenStatic, adLockOptimistic
    If rs2.RecordCount > 0 Then
        rs.Fields("SourceID").Value = rs2.Fields("SourceID").Value
        MsgBox ("Unable to Find Selected LeadSource")
    End If
    rs.Fields("SourcePrefix").Value = "Ann"
    rs.Fields("ID").Value = Int(Rnd)
    If radiobuttonMale.Value = True Then
        rs.Fields("Sex").Value = "M"
        rs.Fields("Sex").Value = "F"
    End If
    rs.Fields("Title").Value = textboxTitle.Text
    rs.Fields("Initials").Value = textboxInitials.Text
    rs.Fields("Surname").Value = textboxSurname.Text
    rs.Fields("Address1").Value = textboxAddress1.Text
    rs.Fields("Address2").Value = textboxAddress2.Text
    rs.Fields("Address3").Value = textboxAddress3.Text
    rs.Fields("PostCode").Value = textboxPostCode.Text
    If textboxRetirementDate.Visible = True Then
        rs.Fields("RetirementDate").Value = textboxRetirementDate.Text
        rs.Fields("RetirementDate").Value = Now
    End If
    rs.Fields("DOB").Value = textboxDOB.Text
    rs.Fields("daytime_telephone").Value = textboxPhoneNumber.Text
    rs.Fields("Email").Value = textboxEmailAddress.Text
    rs.Fields("CoverType1").Value = "Annuity"

Open in new window

Visual Basic ClassicVisual Basic.NETMicrosoft SQL Server 2005

Avatar of undefined
Last Comment

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

brad2575 is correct

Cleaner SP does not exist  is not any built in error message
this is something this object is not exists in database
check is there any triggers on WebEnquiries table
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.