Ms access odbc ошибка вызова

I created an Access front end for a SQL DB on my PC for use throughout my company. I am using a file ODBC connection and putting both the ODBC file and the Access file on a shared network drive.

When I load the access file, for some reason it seems to default to using my windows login credentials and pulls in the data perfectly. When a user attempts to open the file, they receive an error message saying «ODBC —call failed.». I can open the Linked Table Manager for them and check ‘ask for new location’ then specify the ODBC file and it all works fine…however it doesn’t seem to save anything. I get the error each time someone other then myself opens this file.

Any idea what could be wrong? I am not an Access guy by trade, it just seems to be the tool we need for the moment.

—EDIT: For Clarification I am using a file ODBC connection

—Edit 2—

Riddle me this. So I have been troubleshooting this issue and I came across something interesting. I was logged in as one of my users and did the following:

  1. Create a new access file that references a file ODBC connection on the desktop.
  2. Create 3-4 linked tables in the access file, using the ODBC file on the desktop.
  3. Save and close the access file.
  4. Re-Open said file…. and I get an ODBC connection error! Right after everything was fine in a fresh file!

Anyone ever experience this?

asked Apr 23, 2014 at 19:40

user2061929's user avatar

user2061929user2061929

4113 gold badges5 silver badges13 bronze badges

i assume you didn’t install the ODBC correctly on each users PC.
you should create the ODBC-definition. You can create the relevant statements directly in the registry, see this branch
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI

if you give the same name as on your developer machine, then it works. that’s how i do it with my client applications that i develop on my machine and then install it at client site

answered Apr 23, 2014 at 20:39

SEM_jmc's user avatar

4

Well, I was able to narrow the issue a bit. Access for some reason keeps trying to use Windows Credentials instead of the username in my ODBC file. I can’t find a way around it, but I was able to resolve the issue by creating logins on my SQL Server for the windows users that need access.

I am not incredibly happy about needing to manage more logins, but that’s what i did to resolve this issue.

answered Apr 29, 2014 at 12:48

user2061929's user avatar

user2061929user2061929

4113 gold badges5 silver badges13 bronze badges

I don’t mean to resurrect the dead, but I had this same error stem from a different issue.

I was using an ODBC connection. When running the file using the ‘Design’ run button it worked fine. When I tried using the Navigation Pane and double clicking on it, the error would happen.

The structure of my query was the problem; I was porting a SQL server query over and the single quote ‘ parameter passing was not well received in Access. Changing these over to double quotes » made it work.

answered Aug 10, 2018 at 21:54

mark's user avatar

markmark

3381 silver badge11 bronze badges

After beating my head against the wall having this same issue, I finally discovered I had a checkbox on the Access form that defaulted to NULL. Since I put the backend into SQL, the checkbox fields cannot be NULL but the ‘ODBC Call Failed’ message did not help. I finally tried to add a record directly on the table via Access and it gave more information. I set all the checkboxes to default to zero and it resolved the problem!

answered Oct 14, 2020 at 15:51

Rockman527's user avatar

In my case there were columns having +’ or -‘ substring combinations; error disapeared after removing ‘ characters from column definition

answered Jul 7 at 9:52

Kodak's user avatar

KodakKodak

1,7792 gold badges18 silver badges29 bronze badges

I created an Access front end for a SQL DB on my PC for use throughout my company. I am using a file ODBC connection and putting both the ODBC file and the Access file on a shared network drive.

When I load the access file, for some reason it seems to default to using my windows login credentials and pulls in the data perfectly. When a user attempts to open the file, they receive an error message saying «ODBC —call failed.». I can open the Linked Table Manager for them and check ‘ask for new location’ then specify the ODBC file and it all works fine…however it doesn’t seem to save anything. I get the error each time someone other then myself opens this file.

Any idea what could be wrong? I am not an Access guy by trade, it just seems to be the tool we need for the moment.

—EDIT: For Clarification I am using a file ODBC connection

—Edit 2—

Riddle me this. So I have been troubleshooting this issue and I came across something interesting. I was logged in as one of my users and did the following:

  1. Create a new access file that references a file ODBC connection on the desktop.
  2. Create 3-4 linked tables in the access file, using the ODBC file on the desktop.
  3. Save and close the access file.
  4. Re-Open said file…. and I get an ODBC connection error! Right after everything was fine in a fresh file!

Anyone ever experience this?

asked Apr 23, 2014 at 19:40

user2061929's user avatar

user2061929user2061929

4113 gold badges5 silver badges13 bronze badges

i assume you didn’t install the ODBC correctly on each users PC.
you should create the ODBC-definition. You can create the relevant statements directly in the registry, see this branch
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI

if you give the same name as on your developer machine, then it works. that’s how i do it with my client applications that i develop on my machine and then install it at client site

answered Apr 23, 2014 at 20:39

SEM_jmc's user avatar

4

Well, I was able to narrow the issue a bit. Access for some reason keeps trying to use Windows Credentials instead of the username in my ODBC file. I can’t find a way around it, but I was able to resolve the issue by creating logins on my SQL Server for the windows users that need access.

I am not incredibly happy about needing to manage more logins, but that’s what i did to resolve this issue.

answered Apr 29, 2014 at 12:48

user2061929's user avatar

user2061929user2061929

4113 gold badges5 silver badges13 bronze badges

I don’t mean to resurrect the dead, but I had this same error stem from a different issue.

I was using an ODBC connection. When running the file using the ‘Design’ run button it worked fine. When I tried using the Navigation Pane and double clicking on it, the error would happen.

The structure of my query was the problem; I was porting a SQL server query over and the single quote ‘ parameter passing was not well received in Access. Changing these over to double quotes » made it work.

answered Aug 10, 2018 at 21:54

mark's user avatar

markmark

3381 silver badge11 bronze badges

After beating my head against the wall having this same issue, I finally discovered I had a checkbox on the Access form that defaulted to NULL. Since I put the backend into SQL, the checkbox fields cannot be NULL but the ‘ODBC Call Failed’ message did not help. I finally tried to add a record directly on the table via Access and it gave more information. I set all the checkboxes to default to zero and it resolved the problem!

answered Oct 14, 2020 at 15:51

Rockman527's user avatar

In my case there were columns having +’ or -‘ substring combinations; error disapeared after removing ‘ characters from column definition

answered Jul 7 at 9:52

Kodak's user avatar

KodakKodak

1,7792 gold badges18 silver badges29 bronze badges

Search code, repositories, users, issues, pull requests…

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

  • Remove From My Forums
  • Question

  • We have this fairly simple Access database with a link table to a view in an SQL Server. The Select Query in Access is a simple select from this view with a view criteria set. Nothing fancy. What is driving is moderately crazy is that this Select Query in Access seems to work fine for months and than all of a sudden (same query performed around the same time with about the same workload on the SQL-Server) it responses with the helpful «ODBC-Call Failed» message. Closing the Access database, taking a coffee, coming back againg and try the exact same Select Query normally works, no «ODBC-Call Failed» message.

    1. It not happens always, mosty we’re fine.
    2. When it happens it happens for all subsequent queries tried. We have to close and reopen the Access database and pray to the good Lord that it works.

    We would be very interested in someone with a solution to this problem.

Answers

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

Понравилась статья? Поделить с друзьями:
  • Ms contact support ошибка
  • Ms 668 ошибка e10
  • Mr 9963 ошибка мерседес atego
  • Mrs клемма аварийного отключения ошибка bmw e90
  • Mr2509 ошибка мерседес актрос