troubleshooting Question

Run Time Error "Cleaner SP does not exist"

Avatar of ict-torquilclark
ict-torquilclark asked on
Visual Basic ClassicVisual Basic.NETMicrosoft SQL Server 2005
2 Comments1 Solution190 ViewsLast Modified:
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
    rs.addNew
    
    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
    Else
        MsgBox ("Unable to Find Selected LeadSource")
    End If
    rs2.Close
    
    rs.Fields("SourcePrefix").Value = "Ann"
    Randomize
    rs.Fields("ID").Value = Int(Rnd)
    
    If radiobuttonMale.Value = True Then
        rs.Fields("Sex").Value = "M"
    Else
        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
    Else
        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"
    rs.Update
    rs.Close
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros