Range check error with mutiple Oracle clients.

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
stjtaylor
Posts: 4
Joined: Thu 29 Oct 2009 23:22
Location: Melbourne

Range check error with mutiple Oracle clients.

Post by stjtaylor » Thu 14 Jan 2010 08:56

With 2 Oracle Clients installed (10.2.0.1 and 11.1.0) and 10.2 as the default ODAC is producing a "Range Check error" from within the VersionStrToWord function after the incorrect version is returned from GetOCIClientVersion.
Reproducing this may take some experimenting with default Oracle client and changing the selected client in the Oracle Universal Installer.
The error stops ODAC from initializing the oci and obviously connecting.

We were able to fix this by declaring the _OCIClientVersion method (in OraCall) as a function with a sword return value.
The value returned from OCIClientVersion() can then be checked so GetOCIClientVersion() doesn't return an invalid value.

Let me know if you need more information, or have a better\different solution.
Thanks,
Steve.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 14 Jan 2010 09:37

We will add this fix to the next ODAC build.

stjtaylor
Posts: 4
Joined: Thu 29 Oct 2009 23:22
Location: Melbourne

Another Range check error

Post by stjtaylor » Sun 24 Jan 2010 22:34

Hi,
Thanks for the quick response to the last issue.

We found another range check problem.
With multiple clients installed, if one of the clients become invalid eg. if the folder is deleted or the BIN folder is renamed then the newly exposed method TOraServerEnumerator.GetTNSFileName will produce a Range Check error.

Code is:
if (FHomeName = '') and (OracleHomeCount > 0) and then
FileName := AddPath(RegIniFile.ReadString(sOraHomeKey +
OracleHomeKeys[DefaultOracleHome], sTnsAdmin, ''), sTnsNames)

DefaultOracleHome is -1 and produces a Range Check error.
If a check for this is added it works ok.

Thanks,
Steve.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 25 Jan 2010 08:17

We will add this fix to the next ODAC build.

stjtaylor
Posts: 4
Joined: Thu 29 Oct 2009 23:22
Location: Melbourne

Post by stjtaylor » Fri 29 Jan 2010 00:57

I have just downloaded the latest update from 27th Jan.

The first error that required a change to the OCI call is still causing a problem.
It appears that the return value for OCIClientVersion is a non-zero value for success and zero for an unsuccessful call.

Can you take a closer look at the return value please?

Thanks.

Post Reply