Improve company productivity with a Business Account.Sign Up


ODBC ERROR Using MS ODBC for Oracle

Posted on 2006-06-15
Medium Priority
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

595 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