Results 1 to 5 of 5
  1. #1
    Join Date
    May 2009

    Unanswered: ODBC - Connection Failed Error 3146


    I have a situation here.I will be glad if anyone could help.

    We have a Microsoft Access 2003 accessing the SQL Server 2000 database using ODBC connection.I have set the database as a System Datasource with SQL Server driver and the connection settings.

    When i launch the .mdb application,i am able to connect to the database and fetch results.But only while populating the data on one of the combobox,the ODBC connection failed error 3146 arises.

    I turned on the tracing and saw that the SetConnection Attr failed error in the log.

    Any help is highly appreciated.

    Thanks in advance.

  2. #2
    Join Date
    Dec 2004
    Madison, WI
    Are you able to enter data for this field directly into the table? If not, are you able to enter data in this field directly into the SQL Server table (I'm guessing yes.)

    You can also try refreshing (or delete and relink) the linked tables.

    You can also put in a msgbox me!MyProblemField in the AfterUpdate (or BeforeUpdate) event to see what value is actually being saved in the combobox and see if it matches the SQL Server field type.

    I'm not sure what the error exactly means but these are some things I normally do to troubleshoot. My guess is that you may not be passing the correct value type for that field (what is the field type defined as on SQL Server?)

    Or it's a relational problem. Can you explain more on what kind of field type (and what it's for) that is giving you problems?
    Last edited by pkstormy; 05-05-09 at 21:34.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    May 2009

    Connecion Failed Error

    Thanks for your insight.Got the error fixed.

    The ODBC Connect Str property of the pass thru query which the combobox was using wasnt set to the correct server.We had a change in the domain and the server details were still pointing to the old server name.

    When i changed it to point to the new server,it worked.

    Thanks for your help.Appreciate it.


  4. #4
    Join Date
    Aug 2011

    Error 3146

    I am getting the same error only in a different way. I am using VBA code to add a value in a box on the form to a different file. Here is my code:

    Set db = Currentdb()
    strSQL = "Select * from dbo_filestream_files;"
    Set rs = db.OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)

    rs![Prefix_CTRL_NBR].value = Me.Prefix_CTRL_NBR
    rs![CTRL_ID].value = Me.CTRL_NBR

    My code fails on the rs.Update.

    Any suggestions?

  5. #5
    Join Date
    Jun 2013
    I Googled "error 3146" and got this page as first result, so I propose here a link to a solution for generic message "Error 3146: ODBC--call failed":
    How To Get More Information on the ODBC Call Failed Error
    It propose to use a special error handler like this:

    ' DAO Error Handler
    Dim MyError As Error
    Debug.print Errors.Count
    For Each MyError In DBEngine.Errors
    With MyError
    MsgBox .Number & " " & .Description
    End With
    Next MyError

    I found it very usefull

Posting Permissions

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