UniDAC 6.3 RAD Studio 10.1 Berlin Oracle connection "Invalid Home Name"

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
casalii
Posts: 4
Joined: Tue 24 May 2016 07:36

UniDAC 6.3 RAD Studio 10.1 Berlin Oracle connection "Invalid Home Name"

Post by casalii » Tue 24 May 2016 10:04

I want to establish an Oracle Connection with OCI and I followed the description within UniDAC help (UniDAC and Oracle) but i get always the same error. => Invalid Home Name: .

[19FDA4CA]{oraprovider240.bpl} Oracalluni.TOracleHomes.GetHome + $52
[1A006AE7]{oraprovider240.bpl} Oraclassesuni.TOCIConnection.AllocEnvironment + $17
[1A007F00]{oraprovider240.bpl} Oraclassesuni.TOCIConnection.Connect + $38
[107D1A04]{unidac240.bpl} Uni.TUniTransaction.SetITransaction + $30
[105AFF6F]{dac240.bpl } Craccess.TCRConnection.SetServer + $B
[1057612D]{dac240.bpl } Dbaccess.TCustomDAConnection.DoConnect + $E1
[107CE32F]{unidac240.bpl} Uni.TUniConnection.DoConnect + $2F
[10576483]{dac240.bpl } Dbaccess.TCustomDAConnection.PerformConnect + $37
[106A45D7]{dcldac240.bpl} Daconnectioneditor.TDAConnectionEditorForm.PerformConnect + $B
[106A4397]{dcldac240.bpl} Daconnectioneditor.TDAConnectionEditorForm.btConnectClick + $3F
[50AA4097]{vcl240.bpl } Vcl.Controls.TControl.Click (Line 7429, "Vcl.Controls.pas" + 9) + $8
[50AC9A36]{vcl240.bpl } Vcl.StdCtrls.TCustomButton.Click (Line 5434, "Vcl.StdCtrls.pas" + 3) + $2
[50ACA544]{vcl240.bpl } Vcl.StdCtrls.TCustomButton.CNCommand (Line 5895, "Vcl.StdCtrls.pas" + 1) + $D
[50AA3B2A]{vcl240.bpl } Vcl.Controls.TControl.WndProc (Line 7313, "Vcl.Controls.pas" + 91) + $6
[50AA8675]{vcl240.bpl } Vcl.Controls.TWinControl.WndProc (Line 10143, "Vcl.Controls.pas" + 158) + $6
[50AC96E0]{vcl240.bpl } Vcl.StdCtrls.TButtonControl.WndProc (Line 5271, "Vcl.StdCtrls.pas" + 13) + $4
[50AA3764]{vcl240.bpl } Vcl.Controls.TControl.Perform (Line 7091, "Vcl.Controls.pas" + 10) + $8
[50AA87DB]{vcl240.bpl } Vcl.Controls.DoControlMsg (Line 10212, "Vcl.Controls.pas" + 12) + $11
[50AA9267]{vcl240.bpl } Vcl.Controls.TWinControl.WMCommand (Line 10487, "Vcl.Controls.pas" + 1) + $5
[50AA3B2A]{vcl240.bpl } Vcl.Controls.TControl.WndProc (Line 7313, "Vcl.Controls.pas" + 91) + $6
[50AA8786]{vcl240.bpl } Vcl.Controls.TWinControl.DefaultHandler (Line 10184, "Vcl.Controls.pas" + 30) + $19
[50AA3B2A]{vcl240.bpl } Vcl.Controls.TControl.WndProc (Line 7313, "Vcl.Controls.pas" + 91) + $6
[50AA8675]{vcl240.bpl } Vcl.Controls.TWinControl.WndProc (Line 10143, "Vcl.Controls.pas" + 158) + $6
[50060744]{rtl240.bpl } System.TMonitor.TryEnter (Line 18445, "System.pas" + 10) + $0
[500602C4]{rtl240.bpl } System.TMonitor.Enter (Line 18138, "System.pas" + 4) + $2
[50060148]{rtl240.bpl } System.TMonitor.CheckOwningThread (Line 18056, "System.pas" + 2) + $0
[50060452]{rtl240.bpl } System.TMonitor.Exit (Line 18242, "System.pas" + 1) + $2
[50AA7C94]{vcl240.bpl } Vcl.Controls.TWinControl.MainWndProc (Line 9850, "Vcl.Controls.pas" + 3) + $6
[50170C64]{rtl240.bpl } System.Classes.StdWndProc (Line 17178, "System.Classes.pas" + 8) + $0
[0D072F29]{appanalytics240.bpl} Vcl.AppAnalytics.CBTHookProc (Line 245, "Vcl.AppAnalytics.pas" + 31) + $F
[50AA8786]{vcl240.bpl } Vcl.Controls.TWinControl.DefaultHandler (Line 10184, "Vcl.Controls.pas" + 30) + $19
[50AA44EC]{vcl240.bpl } Vcl.Controls.TControl.WMLButtonUp (Line 7562, "Vcl.Controls.pas" + 1) + $6
[50AA3B2A]{vcl240.bpl } Vcl.Controls.TControl.WndProc (Line 7313, "Vcl.Controls.pas" + 91) + $6
[0D04514C]{TrackingSystem240.bpl} TrackingSystemHelp.CBTHookProc (Line 211, "TrackingSystemHelp.pas" + 27) + $F
[50AA7E83]{vcl240.bpl } Vcl.Controls.TWinControl.IsControlMouseMsg (Line 9906, "Vcl.Controls.pas" + 1) + $9
[50AA8675]{vcl240.bpl } Vcl.Controls.TWinControl.WndProc (Line 10143, "Vcl.Controls.pas" + 158) + $6
[50AC96E0]{vcl240.bpl } Vcl.StdCtrls.TButtonControl.WndProc (Line 5271, "Vcl.StdCtrls.pas" + 13) + $4
[50AA7C94]{vcl240.bpl } Vcl.Controls.TWinControl.MainWndProc (Line 9850, "Vcl.Controls.pas" + 3) + $6
[50170C64]{rtl240.bpl } System.Classes.StdWndProc (Line 17178, "System.Classes.pas" + 8) + $0
[50BEFFDD]{vcl240.bpl } Vcl.Forms.TApplication.CancelHint (Line 11363, "Vcl.Forms.pas" + 6) + $D
[50BEEC6F]{vcl240.bpl } Vcl.Forms.TApplication.ProcessMessage (Line 10534, "Vcl.Forms.pas" + 23) + $1
[50BEECB2]{vcl240.bpl } Vcl.Forms.TApplication.HandleMessage (Line 10564, "Vcl.Forms.pas" + 1) + $4
[50BEA1E2]{vcl240.bpl } Vcl.Forms.TCustomForm.ShowModal (Line 7315, "Vcl.Forms.pas" + 33) + $5
[106A3D42]{dcldac240.bpl} Daconnectioneditor.TDAConnectionEditorForm.SetComponent + $E
[10690168]{dcldac240.bpl} Crdesign.TCRComponentEditor.ShowEditorEx + $8C
[106900B6]{dcldac240.bpl} Crdesign.TCRComponentEditor.ShowEditor + $32
[106AEB06]{dcldac240.bpl} Dadesign.TDAComponentEditor.ShowEditor + $46
[10690481]{dcldac240.bpl} Crdesign.TCRComponentEditor.Edit + $D
[2129BE49]{designide240.bpl} ComponentDesigner.TInternalItem.Edit (Line 7793, "ComponentDesigner.pas" + 1) + $F
[212533A0]{designide240.bpl} Designer.TDesigner.Edit (Line 1024, "Designer.pas" + 0) + $4
[2125564F]{designide240.bpl} Designer.TDesigner.MouseDown (Line 1724, "Designer.pas" + 50) + $6
[525BBF99]{vcldesigner240.bpl} VCLSurface.TComponentToolWindow.WndProc (Line 1638, "VCLSurface.pas" + 16) + $32
[525BCA9F]{vcldesigner240.bpl} VCLSurface.TContainer.WndProc (Line 1956, "VCLSurface.pas" + 39) + $6
[525BBDBB]{vcldesigner240.bpl} VCLSurface.TDesignerToolWindow.MainWndProc (Line 1573, "VCLSurface.pas" + 2) + $7
[50170C64]{rtl240.bpl } System.Classes.StdWndProc (Line 17178, "System.Classes.pas" + 8) + $0
[50BEFFDD]{vcl240.bpl } Vcl.Forms.TApplication.CancelHint (Line 11363, "Vcl.Forms.pas" + 6) + $D
[50BEEC6F]{vcl240.bpl } Vcl.Forms.TApplication.ProcessMessage (Line 10534, "Vcl.Forms.pas" + 23) + $1
[50BEECB2]{vcl240.bpl } Vcl.Forms.TApplication.HandleMessage (Line 10564, "Vcl.Forms.pas" + 1) + $4
[50BEEFE5]{vcl240.bpl } Vcl.Forms.TApplication.Run (Line 10702, "Vcl.Forms.pas" + 26) + $3


environment:
OS: Windows 10 Pro (Version 10.0, Build 0, 64-Bit-Edition)
Delphi: Delphi 10.1 Berlin (Version 24.0.22858.6822)
Oracle Server: 12.1.0.2.0
Oracle Client: 12.1.0.2.0 x64

TUniConnection settings:
Provider => Oracle
Server => oovv6 (same as defined in tnsnames.ora)
Username => *******
Password => *******
Direct => False
HomeName => (empty)

test Oracle Connection from Client:
ORACLE_HOME is set correctly in Environment PATH. (echo %ORACLE_HOME% Returns correct path)
TNSPING oovv6 works fine and i can connect with SqlPlus from the Client

tnsnames.ora:
OOVV6 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = db6.xxxxx.xx)(PORT = 1521))
)
(CONNECT_DATA =
(SID = OOVV1)
(SERVER = DEDICATED)
)
)


I also tried to set different values for the HomeName (Path to Client.. or path to bin folder , and so on)... but i get always the same error. I also tried with TUniConnectDialog and from code behind.

The help file describes
If the HomeName option is set to an empty string, the provider uses the first directory from the list of homes encountered in environment PATH variable as the default Oracle home.
but it doesn't work. What name is UniDAC searching for the Oracle home variable ?? The default Name for the variable should be ORACLE_HOME.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: UniDAC 6.3 RAD Studio 10.1 Berlin Oracle connection "Invalid Home Name"

Post by MaximG » Tue 24 May 2016 11:20

T o work with Oracle Client x64 in RAD Studio, you should compile the project for Target Platform - 64-bit Windows

casalii
Posts: 4
Joined: Tue 24 May 2016 07:36

Re: UniDAC 6.3 RAD Studio 10.1 Berlin Oracle connection "Invalid Home Name"

Post by casalii » Tue 24 May 2016 12:02

I know, that the target platform and the Client Version must be the same. I have tried both variants

32bit target platform and 32bit Oracle Client
64bit target platform and 64bit Oracle Client

in both cases i always got the error Invalid Home Name: .

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: UniDAC 6.3 RAD Studio 10.1 Berlin Oracle connection "Invalid Home Name"

Post by MaximG » Wed 25 May 2016 09:20

When using UniDAC on Windows platform, the ORACLE_HOME variable is not used for searching for Oracle client, but Windows registry branches are analyzed. On Windows x64 platform, information about installed Oracle clients will be contained in the HKEY_LOCAL_MACHINE\SOFTWARE\Oracle registry branch. We tested UniDAC behavior in our test environment with installed Oracle Database Client (12.1.0.2.0) for Microsoft Windows (x64). After installation, in the registry branch HKEY_LOCAL_MACHINE\SOFTWARE\Oracle there appeared a KEY_OraClient12Home1 section containing keys with parameters, including ORACLE_HOME_NAME with the value OraClient12Home1. By setting the HomeName parameter to this value you can make sure the connection to the database is successful:
...
UniConnection.SpecificOptions.Values['HomeName'] := 'OraClient12Home1';
UniConnection.Connect;

Check the contents of HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\ and make sure the parameters there are correct.

casalii
Posts: 4
Joined: Tue 24 May 2016 07:36

Re: UniDAC 6.3 RAD Studio 10.1 Berlin Oracle connection "Invalid Home Name"

Post by casalii » Wed 25 May 2016 10:29

Yes, i just wanted to post this behaviour... BUT... this will work only at runtime....
in designtime there is still no connection possible. I tried various combinations to set the HomeName property with no effect (e.g. OraClient12Home1)

I also set a breakpoint after successful connection while debugging and tried the value of the property ConnectString in design time..

ConnectString 'Provider Name=Oracle;Data Source=xxxxx;Home Name=OraClient12Home1;User ID=xxxxxxx;Password=xxxxxxx;Login Prompt=False' .. still no connection at designtime :(

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: UniDAC 6.3 RAD Studio 10.1 Berlin Oracle connection "Invalid Home Name"

Post by MaximG » Wed 25 May 2016 10:42

To work with Oracle DB in Design Time, Oracle Database Client x86 is required, since RAD Studio 10.1 Berlin is a 32-bit application.

casalii
Posts: 4
Joined: Tue 24 May 2016 07:36

Re: UniDAC 6.3 RAD Studio 10.1 Berlin Oracle connection "Invalid Home Name"

Post by casalii » Wed 25 May 2016 11:56

Jesus.. yes i didn't considered this fact... designtime Connection is working now...

I copied a 32bit Oracle Client and added the registry entries.. aftrer that i set the HomeName to the 32bit client Name and all is fine

thanks for help

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: UniDAC 6.3 RAD Studio 10.1 Berlin Oracle connection "Invalid Home Name"

Post by MaximG » Wed 01 Jun 2016 07:08

We are glad to see the problem resolved. Please don't hesitate to contact us with questions concerning UniDAC usage

Post Reply