Registry TNS_ADMIN settings
Registry TNS_ADMIN settings
It appears that the OraServerEnum.GetTNSFileName function doesn't check HKLM\Software\Oracle\[TNS_ADMIN] for a value. I believe that it should do this if it doesn't find this value in any of the home registry locations. The Oracle Client checks this location and uses it (it's common when using Instant Client to put it there if you don't want to use an environment variable for TNS_ADMIN.) Also this function should set Result := '' at the top to avoid the result returning the passed in value if no value is found (the old result is a hidden var argument issue.)
Thanks!
Thanks!
Hi Alex,
It checks the individual registry home locations if they exist, but it does not appear to check the root location. The Oracle Client does check this location, so ODAC should as well. I've modified the code to do it, you just need to add
Right under the if-else clause where it checks the individual homes. Thanks.
-Mark
It checks the individual registry home locations if they exist, but it does not appear to check the root location. The Oracle Client does check this location, so ODAC should as well. I've modified the code to do it, you just need to add
Code: Select all
// Added check for tns_admin in the HKLM\software\Oracle
if FileName = '' then
FileName := AddPath(RegIniFile.ReadString(sOraHomeKey, sTnsAdmin, ''), sTnsNames);
-Mark
Hi Alex,
The code for this in the latest build doesn't actually work. It is:
However Filename will actually be empty there if it hasn't been found yet. The code needs to be:
Thanks,
-Mark
The code for this in the latest build doesn't actually work. It is:
Code: Select all
if FileName = sTnsNames then
FileName := AddPath(RegIniFile.ReadString(sOraHomeKey, sTnsAdmin, ''), sTnsNames);
Code: Select all
if FileName = '' then
FileName := AddPath(RegIniFile.ReadString(sOraHomeKey, sTnsAdmin, ''), sTnsNames);
-Mark