Issue connecting to Oracle 9 from a .Net application

Connecting to Oracle from .NetWhat do you do when, connecting to Oracle 9 using standard DB client from .Net, an error message informs you that at least Oracle version 8.1.7 or higher is needed? We did encounter such a problem while working on a project. Thankfully, after some searching and asking, a solution could be found — read on if you are looking for an answer too.

We saw this issue while creating a standalone ATP/CTP* Client (you can read more about this product on the site of our partner, techwire UK, in the feature titled “Web-based Ordering”) for I-Plan, a supply-chain management application. This client (and the corresponding server-side enhancement) is an application that allows to demonstrates the ATP/CTP logic, usually “hidden” within the main I-Plan core, and also it provides possibility for external systems to send ATP/CTP requests to I-Plan using a web-service API.

Oracle 9 Connection Issue

The problem occured when connecting to Oracle database server version 9, using standard DB client from Microsoft in .Net Framework, System.Data.OracleClient, the following error would return:

System.Data.OracleClient requires Oracle client software version 8.1.7 or greater

So, it would seem that at least Oracle version of 8.1.7 was needed, or greater — while we were using 9! Additional difficulty in investigating and solving the problem was that it didn’t occur on all the servers that we tried it on. So it took us some time to find a solution, therefore we hope it may be useful to you someday.

Solution

To solve it, we had to perform the steps below on every server where the issue occurs — so there is no generic programmatic solution to this, unfortunately. It is required to give the authenticated user a privilege to the Oracle Home in Oracle 9.2 Client software, as follows:

  1. Log on to Windows as a user with Administrator privileges.
  2. Launch Windows Explorer from the Start Menu and and navigate to the ORACLE_HOME folder. This is typically the “Ora92” folder under the “Oracle” folder (i.e. D:OracleOra92).
  3. Right-click on the ORACLE_HOME folder and choose the “Properties” option from the drop down list. A “Properties” window should appear.
  4. Click on the “Security” tab of the “Properties” window.
  5. Click on “Authenticated Users” item in the “Name” list (on Windows XP the “Name” list is called “Group or user names”).
  6. Uncheck the “Read and Execute” box in the “Permissions” list under the “Allow” column (on Windows XP the “Permissions” list is called “Permissions for Authenticated Users”).
  7. Re-check the “Read and Execute” box under the “Allow” column (this is the box you just unchecked).
  8. Click the “Advanced” button and in the “Permission Entries” list make sure you see the “Authenticated Users” listed there with:

    Permission = Read & Execute
    Apply To = This folder, subfolders and files

    If this is NOT the case, edit that line and make sure the “Apply onto” drop-down box is set to “This folder, subfolders and files”. This should already be set properly but it is important that you verify this.

  9. Click the “OK” button until you close out all of the security properties windows. The cursor may present the hour glass for a few seconds as it applies the permissions you just changed to all subfolders and files.
  10. Reboot your computer to assure that these changes have taken effect.

And then it works!

As you can see the solution is far from obvious, especially if one looks at the original error message. Thankfully, there is a helpful development community around Oracle and .Net, so we found the above on one of the forums. Please feel free to post your feedback or questions in the comment form below.


* — ATP/CTP stands for “Available To Promise” and “Capacity To Promise”, two modes for ordering items, the former checking whether the item is available in inventory (across several warehouses, in our case), the latter checking if there is available production capacity to manufacture the required quantity of the material in time.