ODBC ERROR Using MS ODBC for Oracle

Posted on 2006-06-15
Last Modified: 2013-12-12
In a web application using ASP and Oracle, after moving to a new Win 2003 server and re-installing the software,  we had the application working fine, and then the next day we started getting this error:

 "ERROR      2001      Microsoft OLE DB Provider for ODBC Drivers [Microsoft][ODBC driver for Oracle][Oracle] (-2147467259)".  

We can ping the database with no problem.  I set up an Access database and linked to the one of the Oracle tables readily. However, if I close Access and reopen it, I get the "ODBC Connection to [DSN name] failed."  error.  I created a new system ODBC connection using the Oracle ODBC driver and then used that to link to one of the Oracle tables in Access. Worked fine again, until I closed Access and reopened it, then I get the same error as with the Microsoft ODBC DSN.

I have added the IUSER to all the many places (registry, all the relevant directories) to no avail.  I have searched everywhere on this problem and done everything that seems relevant to no avail.  Downloaded new MDAC file from Microsoft and installed it, no difference.

Does anyone have any ideas?  About to pull all my hair out!!

Question by:beechers
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Author Comment

ID: 16943126
I am giving myself the 500 points.  ;-)  I found the solution via searching on Google (despite hours of searching previously).  
To give credit where credit is due:
This is from

SQLSetConnectAttr error : Microsoft ODBC for Oracle, and Oracle 9i client on XP [message #99667] Tue, 12 February 2002 16:47  
Joe Springer
Had a major problem, but solved it, so am posting here so that someone may
Attempting to create an ODBC DSN using Microsoft ODBC for Oracle
(MSORCL32.DLL of 8/23/2001) on Windows XP (which comes with MDAC 2.7), get
the following error:
"Driver's SQLSetConnectAttr failed"

Problem is that the ODBC settings expect Oracle 8.0 to be used by default. So
change the registry to look for Oracle 9 DLLs and DSN creation succeeds.
Need to change 2 registry entries, see HKLMSoftwareMicrosoftMSDTCMTxOCI
and change OracleXaLib from oraclient8.dll to oraclient9.dll and change
OracleSqlLib from orasql8.dll to orasql9.dll (note: if OracleOciLib is
oci.dll do not change it).
(As a reference see outdated Microsoft article Q264012).  

My registry settings were:
HKLM\MSDTC\MTxOCI: OracleSQLLib = SQLLib80.dll
                 : OracleXALIB = Xa80.dll
                 : OracleOciLib = oci.dll

I was initially hesitant because our settings were so different from what he indicated they would be.

However, found the following:

 MDAC 2.8 and Oracle 10g
Posted: May 11, 2005 1:41 PM      Posted by cnikkel
MDAC 2.8 (Microsoft ODBC for Oracle) will connect to Oracle 9i but not 10g,
any ideas? Thanks.

Mark A. Williams  
  Re: MDAC 2.8 and Oracle 10g
Posted: May 12, 2005 6:57 AM    in response to: cnikkel      
 I see you have also posted to the ODBC forum so you might get better help
from there, but, I was able to connect using the MS ODBC driver from MDAC 2.8
to 10g with no problems at all. What error did you receive?
- Mark

Reply  from cnikkel:
I am using winsql with the msorcl32.dll 2.575.1022.00 driver and am getting
the following error, which is not very helpful.
ODBC Error SQL Error State:NA000, Native Code: 0, ODBC Error: [Microsoft][ODBC driver
for Oracle][Oracle]

Mark A. Williams  
  Re: MDAC 2.8 and Oracle 10g
Posted: May 12, 2005 7:27 AM    in response to: cnikkel      
I'm not familiar with winsql, but what I did was create a data source, create
an Access database, then attach a table in a 10g database using that data
source. My version of the driver is 2.575.1117.00 for what it's worth. I
agree that the error message is, umm, slightly less than helpful.
- Mark

Re: MDAC 2.8 and Oracle 10g
Posted: May 12, 2005 8:03 AM    
OK I am using your version of the driver, same error.
I have now tried as you did in MS Access, and am getting a better error message.
Microsoft Office Access
ODBC--call failed.
[Microsoft][ODBC driver for Oracle][Oracle](#0)[Microsoft][ODBC Driver
Manager] Driver's SQLSetConnectAttr failed IM006 0 [Microsoft][ODBC Driver
Manager] Driver's SQLSetConnectAttr failed (#0)

Re: MDAC 2.8 and Oracle 10g
Posted: May 13, 2005 6:50 AM    
I got it, thanks Mark
Update the following registry key with the following information
"OracleXaLib"="oraclient10.dll" "OracleSqlLib"="orasql10.dll"
Make sure your Windows environment variable Path includes the Oracle 10g bin
directory:  C:\Oracle\product\10.1.0\Client_1\bin

 So I changed my registy settings as directed immediately above only putting 9 where ever he had 10 as we are on Oracle 9.2.   That fixed my problems.


Accepted Solution

EE_AutoDeleter earned 0 total points
ID: 17093381
Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.


Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question