Run-Time error 3146 ODBC - Call failed

Posted on 2010-01-04
Last Modified: 2013-11-28
To transfert data to another table I'm using a recordset.
I have an error "Run-Time error 3146 ODBC - Call failed " when my code arrive to update the table ("rsAttendeeLect.Update").
My database is SQL SERVER and my front application is Access 2007.
I can change data from Access table and my other updates on other tables work.

Thanks for your help

If IsNull(Forms!FrmAddAttendeeLecturesOOM!Combo38) Then


 MsgBox ("Please select a lecture")



Dim LResponse As Integer

LResponse = MsgBox("Do you wish to continue?", vbYesNo, "Continue")

    If LResponse = vbYes Then


Set db = CurrentDb

Dim rsAttendee As DAO.Recordset

Dim rqt As String

rqt = "SELECT * FROM dbo_Event_Attendee WHERE a_GoLectureOOM<>" & 0

Set rsAttendee = db.OpenRecordset(rqt, dbOpenDynaset, dbSeeChanges)

Dim rsAttendeeLect As DAO.Recordset

Dim rqt1 As String

rqt1 = "SELECT * FROM dbo_lectures_attendees_OOM"

Set rsAttendeeLect = db.OpenRecordset(rqt1, dbOpenDynaset, dbSeeChanges)

 If rsAttendee.RecordCount <> 0 Then



                       Do Until rsAttendee.EOF




                         rsAttendeeLect!lec_id = Forms!FrmAddAttendeeLecturesOOM!Combo38

                         rsAttendeeLect!Opt_ID = Trim(rsAttendee!Opt_ID)

                         rsAttendeeLect!date_attending = Now

                         'rsAttendeeLect!notes =

                         rsAttendeeLect!att_name = Trim(rsAttendee!A_Name)

                         rsAttendeeLect!att_firstname = Trim(rsAttendee!a_firstname)

                         rsAttendeeLect!att_comp = Trim(rsAttendee!a_company)

                         rsAttendeeLect!att_address = Trim(rsAttendee!a_address)

                         rsAttendeeLect!att_postcode = Trim(rsAttendee!a_postcode)

                         rsAttendeeLect!att_city = Trim(rsAttendee!A_City)

                         rsAttendeeLect!att_province = Trim(rsAttendee!a_province)

                         rsAttendeeLect!att_email = Trim(rsAttendee!a_email)

                         rsAttendeeLect!att_tel = Trim(rsAttendee!A_Tel)

                         rsAttendeeLect!att_lic = Trim(rsAttendee!a_licence)

                         rsAttendeeLect!att_stunum = Trim(rsAttendee!a_student_number)

                         'rsAttendeeLect!att_credits_awarded =





                         rsAttendee!a_GoLectureOOM = 0











    End If

    End If

    End If

End Sub

Open in new window

Question by:SirTKC
    1 Comment
    LVL 22

    Accepted Solution

    Check that the SQL Table doesn't have some required fiields that you are not populating (NOT NULL fields)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now