Skip to content
Advertisement

Access VBA to Import Oracle Table: ODBC–Call Failed

I have written a VBA code in Access 2007 to run a SQL query on Oracle and insert results in an Access table using a Pass-Through query. I am getting the following error: “ODBC–Call Failed“. Below is the code:

I exported this query to a text file and ran it on Oracle, it is running fine! Also, I created a temp table on Oracle with the above SQL query and replaced sql_stmt in VBA with “select * from new_oracle_table”. Strangely, this seems to be working fine as well. Do you think it’s something to do with the length of the SQL query in sql_stmt itself? Any ideas on how to fix this would be greatly appreciated.

-SS

Advertisement

Answer

I was able to solve this error. Just copy the below code into your error handler and it will give you a more detailed description of the ODBC–Call Failed error

This told me that my ODBC connection was being timed out due to the large size of the SQL query. Just follow the steps in the link below to resolve the error.

http://its.uiowa.edu/support/article/101855

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement