Runtime error 3146 odbc ошибка вызова

My client is using Access as a front end to a SQL Server database. They recently started getting ODBC — 3146 errors from time to time when running some reports. From what I can tell, this is just a generic ODBC call failed error.

I’ve tried sticking some error handling in the VB script that is launching the reports, but I am not having any luck getting extra error information.

Code looks a bit like this.

Public Function RunReports()
  On Error GoTo MyErrorTrap

  DoCmd.OpenReport "blah", acViewPreview
  DoCmd.Close

  DoCmd.OpenReport "foo", acViewPreview
  DoCmd.Close

Exit_function:
  Exit Function

MyErrorTrap:
  Dim errX As DAO.Error
  Dim MyError As Error
  If Errors.Count > 1   'This always seems to be 0, so no help
    For Each errX In DAO.Errors  'These are empty even if dont check for Errors.Count
      Debug.Print "ODBC Error"
      Debug.Print errX.Number
      Debug.Print errX.Description
    Next errX
  Else
    Debug.Print "VBA Error"
    Debug.Print Err.Number
    Debug.Print Err.Description
  End If

  'Also have tried checking DBEngine.Errors, but this is empty too

End Function

I’ve also enabled tracing on the ODBC side, but that has bogged things down way too much, and I am so far unable to recreate the ODBC error.

I am completely open for suggestions on how to diagnose this.

В этой статье представлена ошибка с номером Ошибка 3146, известная как Ошибка Microsoft Access 3146, описанная как ODBC — вызов не удался.

О программе Runtime Ошибка 3146

Время выполнения Ошибка 3146 происходит, когда Microsoft Access дает сбой или падает во время запуска, отсюда и название. Это не обязательно означает, что код был каким-то образом поврежден, просто он не сработал во время выполнения. Такая ошибка появляется на экране в виде раздражающего уведомления, если ее не устранить. Вот симптомы, причины и способы устранения проблемы.

Определения (Бета)

Здесь мы приводим некоторые определения слов, содержащихся в вашей ошибке, в попытке помочь вам понять вашу проблему. Эта работа продолжается, поэтому иногда мы можем неправильно определить слово, так что не стесняйтесь пропустить этот раздел!

  • Доступ — НЕ ИСПОЛЬЗУЙТЕ этот тег для Microsoft Access, используйте вместо него [ms-access]
  • Вызов — Вызов действие по вызову подпрограммы кода, внешней программы или сценария в среде программирования.
  • Odbc — Open Database Connectivity ODBC предоставляет стандартный программный интерфейс для доступа к СУБД систем управления базами данных .
  • Access — Microsoft Access, также известный как Microsoft Office Access, представляет собой систему управления базами данных от Microsoft, которая обычно сочетает в себе реляционную СУБД Microsoft JetACE с графическим пользовательским интерфейсом и программным обеспечением. -инструменты разработки.
  • Доступ к Microsoft — Microsoft Access, также известный как Microsoft Office Access, представляет собой систему управления базами данных от Microsoft, которая обычно объединяет реляционное ядро ​​СУБД Microsoft JetACE с графическим пользователем. интерфейс и средства разработки программного обеспечения
Симптомы Ошибка 3146 — Ошибка Microsoft Access 3146

Ошибки времени выполнения происходят без предупреждения. Сообщение об ошибке может появиться на экране при любом запуске %программы%. Фактически, сообщение об ошибке или другое диалоговое окно может появляться снова и снова, если не принять меры на ранней стадии.

Возможны случаи удаления файлов или появления новых файлов. Хотя этот симптом в основном связан с заражением вирусом, его можно отнести к симптомам ошибки времени выполнения, поскольку заражение вирусом является одной из причин ошибки времени выполнения. Пользователь также может столкнуться с внезапным падением скорости интернет-соединения, но, опять же, это не всегда так.

Fix Ошибка Microsoft Access 3146 (Error Ошибка 3146)
(Только для примера)

Причины Ошибка Microsoft Access 3146 — Ошибка 3146

При разработке программного обеспечения программисты составляют код, предвидя возникновение ошибок. Однако идеальных проектов не бывает, поскольку ошибки можно ожидать даже при самом лучшем дизайне программы. Глюки могут произойти во время выполнения программы, если определенная ошибка не была обнаружена и устранена во время проектирования и тестирования.

Ошибки во время выполнения обычно вызваны несовместимостью программ, запущенных в одно и то же время. Они также могут возникать из-за проблем с памятью, плохого графического драйвера или заражения вирусом. Каким бы ни был случай, проблему необходимо решить немедленно, чтобы избежать дальнейших проблем. Ниже приведены способы устранения ошибки.

Методы исправления

Ошибки времени выполнения могут быть раздражающими и постоянными, но это не совсем безнадежно, существует возможность ремонта. Вот способы сделать это.

Если метод ремонта вам подошел, пожалуйста, нажмите кнопку upvote слева от ответа, это позволит другим пользователям узнать, какой метод ремонта на данный момент работает лучше всего.

Обратите внимание: ни ErrorVault.com, ни его авторы не несут ответственности за результаты действий, предпринятых при использовании любого из методов ремонта, перечисленных на этой странице — вы выполняете эти шаги на свой страх и риск.

Метод 1 — Закройте конфликтующие программы

Когда вы получаете ошибку во время выполнения, имейте в виду, что это происходит из-за программ, которые конфликтуют друг с другом. Первое, что вы можете сделать, чтобы решить проблему, — это остановить эти конфликтующие программы.

  • Откройте диспетчер задач, одновременно нажав Ctrl-Alt-Del. Это позволит вам увидеть список запущенных в данный момент программ.
  • Перейдите на вкладку «Процессы» и остановите программы одну за другой, выделив каждую программу и нажав кнопку «Завершить процесс».
  • Вам нужно будет следить за тем, будет ли сообщение об ошибке появляться каждый раз при остановке процесса.
  • Как только вы определите, какая программа вызывает ошибку, вы можете перейти к следующему этапу устранения неполадок, переустановив приложение.

Метод 2 — Обновите / переустановите конфликтующие программы

Использование панели управления

  • В Windows 7 нажмите кнопку «Пуск», затем нажмите «Панель управления», затем «Удалить программу».
  • В Windows 8 нажмите кнопку «Пуск», затем прокрутите вниз и нажмите «Дополнительные настройки», затем нажмите «Панель управления»> «Удалить программу».
  • Для Windows 10 просто введите «Панель управления» в поле поиска и щелкните результат, затем нажмите «Удалить программу».
  • В разделе «Программы и компоненты» щелкните проблемную программу и нажмите «Обновить» или «Удалить».
  • Если вы выбрали обновление, вам просто нужно будет следовать подсказке, чтобы завершить процесс, однако, если вы выбрали «Удалить», вы будете следовать подсказке, чтобы удалить, а затем повторно загрузить или использовать установочный диск приложения для переустановки. программа.

Использование других методов

  • В Windows 7 список всех установленных программ можно найти, нажав кнопку «Пуск» и наведя указатель мыши на список, отображаемый на вкладке. Вы можете увидеть в этом списке утилиту для удаления программы. Вы можете продолжить и удалить с помощью утилит, доступных на этой вкладке.
  • В Windows 10 вы можете нажать «Пуск», затем «Настройка», а затем — «Приложения».
  • Прокрутите вниз, чтобы увидеть список приложений и функций, установленных на вашем компьютере.
  • Щелкните программу, которая вызывает ошибку времени выполнения, затем вы можете удалить ее или щелкнуть Дополнительные параметры, чтобы сбросить приложение.

Метод 3 — Обновите программу защиты от вирусов или загрузите и установите последнюю версию Центра обновления Windows.

Заражение вирусом, вызывающее ошибку выполнения на вашем компьютере, необходимо немедленно предотвратить, поместить в карантин или удалить. Убедитесь, что вы обновили свою антивирусную программу и выполнили тщательное сканирование компьютера или запустите Центр обновления Windows, чтобы получить последние определения вирусов и исправить их.

Метод 4 — Переустановите библиотеки времени выполнения

Вы можете получить сообщение об ошибке из-за обновления, такого как пакет MS Visual C ++, который может быть установлен неправильно или полностью. Что вы можете сделать, так это удалить текущий пакет и установить новую копию.

  • Удалите пакет, выбрав «Программы и компоненты», найдите и выделите распространяемый пакет Microsoft Visual C ++.
  • Нажмите «Удалить» в верхней части списка и, когда это будет сделано, перезагрузите компьютер.
  • Загрузите последний распространяемый пакет от Microsoft и установите его.

Метод 5 — Запустить очистку диска

Вы также можете столкнуться с ошибкой выполнения из-за очень нехватки свободного места на вашем компьютере.

  • Вам следует подумать о резервном копировании файлов и освобождении места на жестком диске.
  • Вы также можете очистить кеш и перезагрузить компьютер.
  • Вы также можете запустить очистку диска, открыть окно проводника и щелкнуть правой кнопкой мыши по основному каталогу (обычно это C :)
  • Щелкните «Свойства», а затем — «Очистка диска».

Метод 6 — Переустановите графический драйвер

Если ошибка связана с плохим графическим драйвером, вы можете сделать следующее:

  • Откройте диспетчер устройств и найдите драйвер видеокарты.
  • Щелкните правой кнопкой мыши драйвер видеокарты, затем нажмите «Удалить», затем перезагрузите компьютер.

Метод 7 — Ошибка выполнения, связанная с IE

Если полученная ошибка связана с Internet Explorer, вы можете сделать следующее:

  1. Сбросьте настройки браузера.
    • В Windows 7 вы можете нажать «Пуск», перейти в «Панель управления» и нажать «Свойства обозревателя» слева. Затем вы можете перейти на вкладку «Дополнительно» и нажать кнопку «Сброс».
    • Для Windows 8 и 10 вы можете нажать «Поиск» и ввести «Свойства обозревателя», затем перейти на вкладку «Дополнительно» и нажать «Сброс».
  2. Отключить отладку скриптов и уведомления об ошибках.
    • В том же окне «Свойства обозревателя» можно перейти на вкладку «Дополнительно» и найти пункт «Отключить отладку сценария».
    • Установите флажок в переключателе.
    • Одновременно снимите флажок «Отображать уведомление о каждой ошибке сценария», затем нажмите «Применить» и «ОК», затем перезагрузите компьютер.

Если эти быстрые исправления не работают, вы всегда можете сделать резервную копию файлов и запустить восстановление на вашем компьютере. Однако вы можете сделать это позже, когда перечисленные здесь решения не сработают.

Другие языки:

How to fix Error 3146 (Microsoft Access Error 3146) — ODBC—call failed.
Wie beheben Fehler 3146 (Microsoft Access-Fehler 3146) — ODBC—Aufruf fehlgeschlagen.
Come fissare Errore 3146 (Errore di Microsoft Access 3146) — ODBC: chiamata non riuscita.
Hoe maak je Fout 3146 (Microsoft Access-fout 3146) — ODBC—aanroep mislukt.
Comment réparer Erreur 3146 (Erreur Microsoft Access 3146) — ODBC—l’appel a échoué.
어떻게 고치는 지 오류 3146 (마이크로소프트 액세스 오류 3146) — ODBC—호출에 실패했습니다.
Como corrigir o Erro 3146 (Erro 3146 do Microsoft Access) — ODBC — falha na chamada.
Hur man åtgärdar Fel 3146 (Microsoft Access-fel 3146) — ODBC-samtal misslyckades.
Jak naprawić Błąd 3146 (Błąd Microsoft Access 3146) — ODBC — wywołanie nie powiodło się.
Cómo arreglar Error 3146 (Error 3146 de Microsoft Access) — ODBC: la llamada falló.

The Author Об авторе: Фил Харт является участником сообщества Microsoft с 2010 года. С текущим количеством баллов более 100 000 он внес более 3000 ответов на форумах Microsoft Support и создал почти 200 новых справочных статей в Technet Wiki.

Следуйте за нами: Facebook Youtube Twitter

Последнее обновление:

24/05/22 01:21 : Пользователь Android проголосовал за то, что метод восстановления 1 работает для него.

Рекомендуемый инструмент для ремонта:

Этот инструмент восстановления может устранить такие распространенные проблемы компьютера, как синие экраны, сбои и замораживание, отсутствующие DLL-файлы, а также устранить повреждения от вредоносных программ/вирусов и многое другое путем замены поврежденных и отсутствующих системных файлов.

ШАГ 1:

Нажмите здесь, чтобы скачать и установите средство восстановления Windows.

ШАГ 2:

Нажмите на Start Scan и позвольте ему проанализировать ваше устройство.

ШАГ 3:

Нажмите на Repair All, чтобы устранить все обнаруженные проблемы.

СКАЧАТЬ СЕЙЧАС

Совместимость

Требования

1 Ghz CPU, 512 MB RAM, 40 GB HDD
Эта загрузка предлагает неограниченное бесплатное сканирование ПК с Windows. Полное восстановление системы начинается от $19,95.

ID статьи: ACX06523RU

Применяется к: Windows 10, Windows 8.1, Windows 7, Windows Vista, Windows XP, Windows 2000

Icon Ex Номер ошибки: Ошибка 3146
Название ошибки: Microsoft Access Error 3146
Описание ошибки: ODBC—call failed.
Разработчик: Microsoft Corporation
Программное обеспечение: Microsoft Access
Относится к: Windows XP, Vista, 7, 8, 10, 11

Обзор «Microsoft Access Error 3146»

Как правило, практикующие ПК и сотрудники службы поддержки знают «Microsoft Access Error 3146» как форму «ошибки во время выполнения». Когда дело доходит до Microsoft Access, инженеры программного обеспечения используют арсенал инструментов, чтобы попытаться сорвать эти ошибки как можно лучше. К сожалению, многие ошибки могут быть пропущены, что приводит к проблемам, таким как те, с ошибкой 3146.

Некоторые люди могут столкнуться с сообщением «ODBC—call failed.» во время работы программного обеспечения. Сообщение об этой ошибке 3146 позволит разработчикам обновить свое приложение и исправить любые ошибки, которые могут вызвать его. Затем Microsoft Corporation исправит ошибки и подготовит файл обновления для загрузки. Эта ситуация происходит из-за обновления программного обеспечения Microsoft Access является одним из решений ошибок 3146 ошибок и других проблем.

«Microsoft Access Error 3146» чаще всего может возникать при загрузке Microsoft Access. Рассмотрим распространенные причины ошибок ошибки 3146 во время выполнения:

Ошибка 3146 Crash — Ошибка 3146 является хорошо известной, которая происходит, когда неправильная строка кода компилируется в исходный код программы. Это возникает, когда Microsoft Access не реагирует на ввод должным образом или не знает, какой вывод требуется взамен.

Утечка памяти «Microsoft Access Error 3146» — если есть утечка памяти в Microsoft Access, это может привести к тому, что ОС будет выглядеть вялой. Возможные искры включают сбой освобождения, который произошел в программе, отличной от C ++, когда поврежденный код сборки неправильно выполняет бесконечный цикл.

Ошибка 3146 Logic Error — логическая ошибка возникает, когда Microsoft Access производит неправильный вывод из правильного ввода. Когда точность исходного кода Microsoft Corporation низкая, он обычно становится источником ошибок.

Как правило, такие Microsoft Corporation ошибки возникают из-за повреждённых или отсутствующих файлов Microsoft Access Error 3146, а иногда — в результате заражения вредоносным ПО в настоящем или прошлом, что оказало влияние на Microsoft Access. Как правило, решить проблему можно заменой файла Microsoft Corporation. Помимо прочего, в качестве общей меры по профилактике и очистке мы рекомендуем использовать очиститель реестра для очистки любых недопустимых записей файлов, расширений файлов Microsoft Corporation или разделов реестра, что позволит предотвратить появление связанных с ними сообщений об ошибках.

Ошибки Microsoft Access Error 3146

Эти проблемы Microsoft Access, связанные с Microsoft Access Error 3146, включают в себя:

  • «Ошибка программы Microsoft Access Error 3146. «
  • «Недопустимая программа Win32: Microsoft Access Error 3146»
  • «Извините, Microsoft Access Error 3146 столкнулся с проблемой. «
  • «Microsoft Access Error 3146 не может быть найден. «
  • «Microsoft Access Error 3146 не найден.»
  • «Ошибка запуска программы: Microsoft Access Error 3146.»
  • «Microsoft Access Error 3146 не работает. «
  • «Ошибка Microsoft Access Error 3146. «
  • «Неверный путь к программе: Microsoft Access Error 3146. «

Обычно ошибки Microsoft Access Error 3146 с Microsoft Access возникают во время запуска или завершения работы, в то время как программы, связанные с Microsoft Access Error 3146, выполняются, или редко во время последовательности обновления ОС. Важно отметить, когда возникают проблемы Microsoft Access Error 3146, так как это помогает устранять проблемы Microsoft Access (и сообщать в Microsoft Corporation).

Создатели Microsoft Access Error 3146 Трудности

Заражение вредоносными программами, недопустимые записи реестра Microsoft Access или отсутствующие или поврежденные файлы Microsoft Access Error 3146 могут создать эти ошибки Microsoft Access Error 3146.

В частности, проблемы Microsoft Access Error 3146 возникают через:

  • Недопустимая или поврежденная запись Microsoft Access Error 3146.
  • Вредоносные программы заразили Microsoft Access Error 3146, создавая повреждение.
  • Другая программа (не связанная с Microsoft Access) удалила Microsoft Access Error 3146 злонамеренно или по ошибке.
  • Другая программа, конфликтующая с Microsoft Access Error 3146 или другой общей ссылкой Microsoft Access.
  • Microsoft Access (Microsoft Access Error 3146) поврежден во время загрузки или установки.

Продукт Solvusoft

Загрузка
WinThruster 2022 — Проверьте свой компьютер на наличие ошибок.

Совместима с Windows 2000, XP, Vista, 7, 8, 10 и 11

Установить необязательные продукты — WinThruster (Solvusoft) | Лицензия | Политика защиты личных сведений | Условия | Удаление

  • Remove From My Forums
  • Вопрос

  • Hi all,

    I have  a MSaccess front end and SQL server 2005 back end. The functionality is that in the front-end VBA code the application compares the data in the text files which are linked to the application with the data in the tables in SQL server and updates
    the SQL server tables.

    My problem is that whenever there is a key constraint violated or we try to insert duplicates into the primary key or any other error …. The message box shows only :

    error 3146: ODBC link Failed.

     There is no detailed descrition like the one we get in SQL server where the error and the cause both are shown. Is there a way to retreive the entire error???

    Note: This question has not been answered in any previous post. kindly do not think otherwise.

    Thanks in advance.

Ответы

  • I assume that you are using the ODBC DSN for communicating with the backend SQL Server 2005 DB from your front end Access Application. Can you enable ODBC logging following the instructions in :
    http://support.microsoft.com/kb/274551 [How To Generate an ODBC Trace with ODBC Data Source Administrator]

    This ODBC trace can give you more details about the exceptions you see on the application..

    Note: Do not forget to turn tracing off when you are done with the troubleshooting. If you keep tracing set to on, it degrades your application performance.

    Hope this helps..


    Chaitanya( Twitter |
    Blogs )

    Any documentation bug? Tell us about it at
    Connect. Please feel free to add any community comments in any of the MSDN/technet articles.
    This posting is provided «AS IS» with no warranties, and confers no rights.

    The next CTP for SQL Server Code Name «Denali» is coming soon.
    Sign up now to be notified of the next CTP release.

    • Помечено в качестве ответа

      13 июля 2011 г. 7:41

  • Home
  • VBForums
  • Visual Basic
  • Office Development
  • RUNTIME ERROR ‘3146’..ODBC-Call Failed

  1. May 9th, 2005, 11:41 PM

    #1

    nagasrikanth is offline

    Thread Starter


    Hyperactive Member

    nagasrikanth's Avatar


    Lightbulb RUNTIME ERROR ‘3146’..ODBC-Call Failed

    Hi..

    Im using SQL server as my backend and MS Access as F.E..

    Im using to update around 10 to 20 records one by one by upto 2 to 3 records it was updating, later for 4th record it was saying «RUNTIME ERROR ‘3146’..ODBC-Call Failed»(at «rst.update» it was showing)
    ..at that time if i start agian from «rst.addnew» then for upto 3 to 4 it was okay..Is there any limitation in adding records.???
    FYI: Im not getting if i update 1 or 2 records..and
    one more thing that i came to know was ,If the table was a ordinary Access Table..Im not getting any error..
    One more thing was If i place some time delay using msgbox (like msgbox «Updated…» for example)that means for each record I placed a message updated..then it was working perfectly on to my surprise..

    Please help me in this regard..Please..

    Thanks & regards
    Anu…


  2. May 9th, 2005, 11:46 PM

    #2

    Re: RUNTIME ERROR ‘3146’..ODBC-Call Failed

    Sounds like your updating/adding records through Access tables/queries and not directly to the SQL tables? Alos, probably
    using a recordset to add/update when you could execute a sql INSERT statement or an sql UPDATE statement.

    Recordsets are slow. You can create a connection to SQL using ADO, DAO, ODBC to perform your actions.

    VB/Office Guru� (AKA: Gangsta Yoda)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum. Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru� Word SpellChecker�.NETVB/Office Guru� Word SpellChecker� VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24″ LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6


  3. May 9th, 2005, 11:59 PM

    #3

    nagasrikanth is offline

    Thread Starter


    Hyperactive Member

    nagasrikanth's Avatar


    Lightbulb Re: RUNTIME ERROR ‘3146’..ODBC-Call Failed

    Hi Rob,
    Thanx for u r quick reply..
    But Im using SQL tables it self,(Sql tables are linked in my database..)
    and whenever i want to insert new records im opening a connection using
    set rst=currentdb.openrecordset(sql string…….)
    and im inserting a new row by using AddNew and Update methods (not by using sql Queries)

    What i have to do speed up my recordset..Please help..

    Thanx & Regards
    Srikanth


  4. May 10th, 2005, 12:09 AM

    #4

    Re: RUNTIME ERROR ‘3146’..ODBC-Call Failed

    The slowness is from Access having to connect its linked ODBC connection to your SQL db/table via a rs. You could
    execute a statement like so.

    VB Code:

    1. Dim lRecs As Long

    2.     Access.CurrentDb.Connection.Execute "INSERT INTO Table1 VALUES('Testing')", lRecs

    3.     MsgBox lRecs & " records added", vbOKOnly + vbInformation

    VB/Office Guru� (AKA: Gangsta Yoda)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum. Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru� Word SpellChecker�.NETVB/Office Guru� Word SpellChecker� VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24″ LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6


  • Home
  • VBForums
  • Visual Basic
  • Office Development
  • RUNTIME ERROR ‘3146’..ODBC-Call Failed


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules


Click Here to Expand Forum to Full Width

Question & Answer

Question

Using Microsoft® Access 97 and getting «ODBC—call failed (error 3146)» error message. However, in a DB2® CLI trace, you see the error to be «[IBM][CLI Driver][DB2] SQL0180N The syntax of the string representation of a datetime value is incorrect. SQLSTATE=22007».

Cause

The problem is that Microsoft Access is using SQL_C_DEFAULT instead of providing an actual data type during the SQLBindParameter() call. The SQL_C_DEFAULT data format for SQL_TYPE_TIME is a SQL_C_TYPE_TIME data structure. The SQL_C_DEFAULT data format for SQL_TYPE_TIMESTAMP is a SQL_C_TYPE_TIMESTAMP data structure. The SQL_C_DEFAULT data format for SQL_TYPE_DATE is a SQL_C_TYPE_DATE data structure

However, the buffers Microsoft Access gives DB2 contain SQL_C_CHAR data, i.e. ASCII data.

If you refer to ODBC Specification:

http://msdn2.microsoft.com/en-us/library/ms131462(SQL.100).aspx

you can see that the table clearly shows that when SQL_C_DEFAULT is provided for a
SQL_TYPE_TIME column, a SQL_C_TYPE_TIME structure is assumed; that when SQL_C_DEFAULT is provided for a SQL_TYPE_TIMESTAMP column, a SQL_C_TYPE_TIMESTAMP structure is assumed; and that when SQL_C_DEFAULT is provided for a SQL_TYPE_DATE column, a SQL_C_TYPE_DATE structure is assumed. These structures have the following definitions:

http://msdn2.microsoft.com/en-us/library/ms714556.aspx

e.g. struct tagTIME_STRUCT {
SQLUSMALLINT hour;
SQLUSMALLINT minute;
SQLUSMALLINT second;
} TIME_STRUCT;[a]

This is not a DB2 issue, but may be a Microsoft Access issue since these structures do not contain ASCII character data. However, DB2 has a workaround to satisfy IBM DB2 customers.

Answer

The following CLI Configuration Keywords were added to DB2 v8.1 fixpack 4 as a workaround (depending on the data type of concern):

MapTimeDescribe=1
MapTimeStampDescribe=1
MapDateDescribe=1

=============================================================================

For DB2 v7.2 customers:

This works in DB2 v7.2 because Microsoft Access gives DB2 a SQLType of SQL_CHAR during the SQLBindParameter() call. As such, DB2 will read SQL_C_CHAR data from the application specified buffer.

[{«Product»:{«code»:»SSEPGG»,»label»:»Db2 for Linux, UNIX and Windows»},»Business Unit»:{«code»:»BU058″,»label»:»IBM Infrastructure w/TPS»},»Component»:»Programming Interface — CLI»,»Platform»:[{«code»:»PF033″,»label»:»Windows»}],»Version»:»9.5;9.1;8″,»Edition»:»All Editions»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}}]

  • Remove From My Forums
  • Question

  • All

    We have a Pervasive SQL server on which I try to make an ODBC-connection.  I have code below.  It fails on the last line with message runtime error 3146: ODBC-call failed.  The Pervasive ODBC Client is installed and the name of server and
    database is correct.  If I use the import ODBC-function in Access, it works as expected but I must link it by using VBA.

     Set db = CurrentDb
        Set td = db.TableDefs(strTable)
        If Err.Number <> 0 Then
            Set td = db.CreateTableDef(strTable)
            td.Connect = «ODBC;Driver={Pervasive ODBC Client Interface};ServerName=svPSQL;dbq=@Purch»
            td.SourceTableName = strTable
            db.TableDefs.Append td

    End If

Answers

  • I found the issue, the connection string has to be:

    td.Connect = «ODBC;Driver={Pervasive ODBC Interface};ServerName=svPSQL;dbq=@Purch»

    • Marked as answer by

      Tuesday, June 23, 2020 9:20 AM

  • Remove From My Forums
  • Question

  • Hi all,

    I have  a MSaccess front end and SQL server 2005 back end. The functionality is that in the front-end VBA code the application compares the data in the text files which are linked to the application with the data in the tables in SQL server and updates
    the SQL server tables.

    My problem is that whenever there is a key constraint violated or we try to insert duplicates into the primary key or any other error …. The message box shows only :

    error 3146: ODBC link Failed.

     There is no detailed descrition like the one we get in SQL server where the error and the cause both are shown. Is there a way to retreive the entire error???

    Note: This question has not been answered in any previous post. kindly do not think otherwise.

    Thanks in advance.

Answers

  • I assume that you are using the ODBC DSN for communicating with the backend SQL Server 2005 DB from your front end Access Application. Can you enable ODBC logging following the instructions in :
    http://support.microsoft.com/kb/274551 [How To Generate an ODBC Trace with ODBC Data Source Administrator]

    This ODBC trace can give you more details about the exceptions you see on the application..

    Note: Do not forget to turn tracing off when you are done with the troubleshooting. If you keep tracing set to on, it degrades your application performance.

    Hope this helps..


    Chaitanya( Twitter |
    Blogs )

    Any documentation bug? Tell us about it at
    Connect. Please feel free to add any community comments in any of the MSDN/technet articles.
    This posting is provided «AS IS» with no warranties, and confers no rights.

    The next CTP for SQL Server Code Name «Denali» is coming soon.
    Sign up now to be notified of the next CTP release.

    • Marked as answer by

      Wednesday, July 13, 2011 7:41 AM

My client is using Access as a front end to a SQL Server database. They recently started getting ODBC — 3146 errors from time to time when running some reports. From what I can tell, this is just a generic ODBC call failed error.

I’ve tried sticking some error handling in the VB script that is launching the reports, but I am not having any luck getting extra error information.

Code looks a bit like this.

Public Function RunReports()
  On Error GoTo MyErrorTrap

  DoCmd.OpenReport "blah", acViewPreview
  DoCmd.Close

  DoCmd.OpenReport "foo", acViewPreview
  DoCmd.Close

Exit_function:
  Exit Function

MyErrorTrap:
  Dim errX As DAO.Error
  Dim MyError As Error
  If Errors.Count > 1   'This always seems to be 0, so no help
    For Each errX In DAO.Errors  'These are empty even if dont check for Errors.Count
      Debug.Print "ODBC Error"
      Debug.Print errX.Number
      Debug.Print errX.Description
    Next errX
  Else
    Debug.Print "VBA Error"
    Debug.Print Err.Number
    Debug.Print Err.Description
  End If

  'Also have tried checking DBEngine.Errors, but this is empty too

End Function

I’ve also enabled tracing on the ODBC side, but that has bogged things down way too much, and I am so far unable to recreate the ODBC error.

I am completely open for suggestions on how to diagnose this.

Suddenly you’re running into errors while using Microsoft Access to query your official database and you get ** Run Time Error 3146 «ODBC Call Failed» **. In such cases, it’s important to identify the root cause and explore the solutions to fix this irritating error and continue your work. This guide will help you identify and fix the Run Time Error 3146 with simple steps and explanations.

What Does Run Time Error 3146 Mean?

The Run Time Error 3146 is a type of system error when trying to access a Microsoft Access database with an ODBC (Open Database Connectivity) connection. This error appears when the database does not have the correct version of the ODBC driver or the connection string being used has expired.

How to Fix Run Time Error 3146

Here are a couple of solutions you can try to get rid of this error.

Updating your ODBC Driver

If your ODBC driver is out of date, then you should consider updating the driver to its latest version. This can be done with a few simple steps:

  1. Open the Control Panel
  2. Click on the Administrative Tools
  3. Select Data Sources (ODBC)
  4. Under System DNS tab click on Add
  5. Select the Microsoft Access Driver/ engine
  6. Click on Finish

Refreshing your Connection String

Sometimes the connection string for your database gets expired and can cause ** Run Time Error 3146 ** . To resolve this you need to refresh the connection string to your database by following these steps:

  1. Connect to the database
  2. Go to the Current Connections tab
  3. To refresh the connection string, click on the Options dropdown menu
  4. Click on Connection String (Edit) on the menu
  5. A Connection String Builder Dialog Box will open up. Enter all the relevant database login information
  6. Click on Test Connection
  7. If successful, click on OK

FAQs

What is the purpose of the ODBC driver?

The ODBC driver is a data access technology that enables database applications to access an external database. It is designed to provide consistent database access from multiple applications and platforms.

What is the Run Time Error 3146?

Run Time Error 3146 is an error which occurs when there is an issue with database connection, usually due to either an outdated version of the ODBC driver or an expired connection string used to access the database.

What is a Connection String?

A connection string is a string of text which is used to store connection details for a database. Connection strings are usually used for when accessing a database from a computer program such as Microsoft Access.

How do I test my connection string?

To test your connection string, connect to the database, go to the Current Connections tab then Options, select ‘Connection String (Edit)’. This will bring up the Connection String Builder Dialog Box which is where you enter the database login details. After entering the details, click on Test Connection to test the connection string.

How do I update my ODBC Driver?

Updating your ODBC Driver can be done by opening the Control Panel, clicking on Administrative Tools then Data Sources (ODBC). Under the System DNS tab, click on Add and select the Microsoft Access Driver/Engine. Click Finish to install the latest version of ODBC driver.

Getting Run Time Error «3146 ODBC connection failed error constantly»? Wants to know why such error coming on your screen Then get solution of this issue read this post.

Well this error might open at any point within database when setup and associated to database on additional PC.  Most common alternative are either faulty network card or SQL will terminate connection after 30 minutes of inactivity for security reasons.

Scenario: I am got a situation where I run a set of reports for different areas. Most of the areas work but I got this error Error (3146) ODBC call failed.

[Oracle][OCBC][Ora]ORA-00600: internal error code, arguments.

Note: if you are receiving error without program and database sitting idle for for than 30 minutes then you must contact IT professional so as to make sure that your network connection is setup and operating properly.

What Causes Run Time Error 3146 Odbc Call Failed Access?

This error 3146 odbc call failed error is because of the misconfigured system files in your windows operating system.

Common Run Time 3146 Error:

Here is the listing of some of the very common Run Time Error 3146 Odbc Call Failed Access that you can get or which are mostly appear on windows based system.

  • «This application failed to start because Run Time Error 3146 Odbc Call Failed Access was not found. Re-installing the application may fix this problem.»
  • «The file Run Time Error 3146 Odbc Call Failed Access is missing.»
  • «Run Time Error 3146 Odbc Call Failed Access not found.»
  • «Run Time Error 3146 Odbc Call Failed Access Access Violation.»
  • «Cannot register Run Time Error 3146 Odbc Call Failed Access.»
  • «Cannot find %PROGFILES64%WIDCOMMBluetooth SoftwareRun Time Error 3146 Odbc Call Failed Access.»
  • «Cannot start Bluetooth Software. A required component is missing: Run Time Error 3146 Odbc Call Failed Access. Please install Bluetooth Software again.»

How To Solve Run Time Error 3146 Odbc Call Failed Access?

  • You can fix this error by updating windows 7 for the latest versions. Click Start button, and kind windows update in search box. After then click windows update as being shown in the picture given below.
  • Make sure that is there is any update available or not. If a windows shows that you have important updates available then please update it in time. Windows update is vital procedure to mend Run Time Error 3146 Odbc Call Failed Access problem.

  • Start your pc and log on as being an administrator.
  • Now go to the start button and then select All Programs> Accessories>System Tools> click to system restore.
  • In this newly opened window select «Restore my computer to a earlier time» option and after then click to the next option.
  • Select the most up dated system restore point from your «For this list, click a restore point» list, and then click Next.
  • Click next in the confirmation window.
  • After completion of the restoration process restart the pc.

Try this workaround this will surely work in fixing off the Run Time Error 3146. 

Hello,

I have a small VBA Excel app that queries an Oracle database.

Certain tables I hit are quite large, and queries on these large tables (with their associated large datasets) cause the following error:

«Run-time error 3146»

«ODBC call failed»

Googling leads me to believe that this is some sort of timeout problem.

Here is the code I use (in part, all variables are appropriately dim’d):

[code]

strSQL = strSelect & strFrom & strWhere & strAnd & strMachines & strGroupBy
Set qdfData = dbMyDB.CreateQueryDef(«», strSQL)
strMyServer = «myserver» & «;»
strDBConn = «ODBC;DRIVER={Oracle in OraHome92};SERVER=» & strMyServer
qdfData.Connect = strDBConn & «UID=user_id;DBQ=» & strMyServer & «pwd=password;»


[/code]

I don’t have a problem with queries of small tables, only the large ones.

I read that it’s possible to set connection.timeout = 0 to avoid this error, but I am VERY new to VBA and don’t know how to incorporate that into this code.

Any help is appreciated.

Понравилась статья? Поделить с друзьями:
  • Run dll возникла ошибка при запуске
  • Runtime broker ошибка приложения
  • Runtime broker windows 10 ошибка
  • Runtime broker exe системная ошибка
  • Runonce exe ошибка приложения