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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JDeveloper 12c for 32 bit 4 84
How can I rollback insert statements after commit in oracle? 7 134
Oracle query output question 4 43
Oracle - SQL Parse String 5 34
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

777 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