Determine real cause of ODBC failure (error 3146) with ms-access? Determine real cause of ODBC failure (error 3146) with ms-access? vba vba

Determine real cause of ODBC failure (error 3146) with ms-access?


Use the DbEngine.Errors collection.

Sub Update_Temp()On Error GoTo ErrorTrap    ' Execute connect code at this pointExit_errortrap:    Exit SubErrorTrap:    Dim myerror As DAO.Error    For Each myerror In DBEngine.Errors        With myerror            If .Number <> 3146 Then                MsgBox .Description            End If        End With    Next    Resume Exit_errortrapEnd Sub

To enable this code, make sure in VBA settings that error handling is turned on.