Properly Install Oracle ODAC With ODT 11.2.3.20

1.5k views Asked by At

Ok - I have VS 2012 and VS 2013 installed on a 32-bit developer machine running Windows 7 Enterprise and am attempting to connect to an Oracle 9 database. I can install version 12.1.0.24 without a problem, and I can connect to most databases using ODP.NET Managed and Unmanaged drivers through Server Data Connections tool, etc. Problem is that I also have to build applications that connect to legacy Oracle DB Server instances, and really need an older version of the VS Tools and ODP.NET / ODAC, ie 11.2.3.20. This seemingly installs correctly, but when you try to build a new data connection, the default Data Provider is ".NET Framework Data Provider for Oracle" There is an option for "Oracle Data Provider for .NET", but there is seemingly no way to specify a tnsnames.ora location, and the only option available in the "Data Source Name" combo is "(Local Database)."

Furthermore no option for picking Managed or Unmanaged for the Provider is available. Can somebody please tell me the proper thing to do to get this to work? Are there machine-wide configurations I have to make manually, that the installer for 12.1.0.24 does automatically?

1

There are 1 answers

2
Wernfried Domscheit On

Usually there is no need to install more than one Oracle Client (resp. one each for 32-bit and 64-bit). You can connect to older database with 12.1 client (for Managed Driver the Database must be 10.2 or newer).

Most likely you messed up your Oracle installation, remove them all and install one version from scratch.

In order to make you application independent from installed Oracle Client open *.csproj, resp. *.vbproj file and edit reference to ODP.NET like this:

<Reference Include="Oracle.DataAccess">
  <SpecificVersion>False</SpecificVersion>
  <Private>False</Private>
</Reference>

Attributes like Version=... or processorArchitecture=... are not required. Your application will load the correct Oracle.DataAccess.dll depending on selected architecture and target .NET framework (provided that it is installed properly)

"Oracle.DataAccess" and "Oracle.ManagedDataAccess" are different assemblies, so you cannot use them seamless - unless you use DbProviderFactory and such stuff.