Search code examples
oracle-databasedelphifiredac

Delphi FireDac + Oracle without Oracle Client Instalation


Is there any way I can connect my Delphi application (FireDac) to an Oracle database directly?

Currently I can make the connection, but I need to install Oracle Client

on the embarcadero site (http://docwiki.embarcadero.com/RADStudio/Rio/en/Connect_to_Oracle_Server_(FireDAC)) only shows how to connect to the installed client.

I generated a demo that connects using host, port and instance name.

on the machine that the installed client works perfect. already in the machine that does not have the client, even with all the dll, does not connect, presenting the following error:

[FireDAC] [Phys] [Ora] -1309. OCI is not properly installed on this machine (NOE1 / INIT).

even the dll oci.dll being in the same directory as the application,

follows code for connection:

procedure TForm1.btnConectarClick(Sender: TObject);
begin
   conDados.Close;
   conDados.Params.DriverID := 'Ora';
   conDados.Params.Database := '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.xxx)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = SMARTSRV)))';
   conDados.Params.UserName := 'xxxxx';
   conDados.Params.Password := 'xxxxx';
   conDados.Open();
end;

Another setting that did not work either

   conDados.Close;
   // conDados.Params.DriverID := 'Ora';
   // conDados.Params.Database := '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.xxx)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = xxx)))';
   // conDados.Params.UserName := 'xxx';
   // conDados.Params.Password := 'xxx';
   conDados.Params.DriverID := 'Ora';
   conDados.Params.Database := '192.168.0.xxx:1521/xxx';
   conDados.Params.Values['OSAuthent'] := 'No';
   conDados.Params.UserName := 'xxx';
   conDados.Params.Password := 'xxx';
   conDados.Params.Values['CharacterSet'] := 'UTF8';
   odlDados.DriverID := 'Ora';
   odlDados.NLSLang := 'AMERICAN_AMERICA.WE8ISO8859P1';
   odlDados.VendorHome := ExtractFileDir(Application.ExeName);
   odlDados.VendorLib := ExtractFilePath(Application.ExeName) + 'oci.dll';
   conDados.Open();

Is there any way I can connect my Delphi application (FireDac) to an Oracle database directly?

Thanks


Solution

  • after other attempts, we find that the error is generated by the msvcr120.dll dll, but it is not described in the error.

    we installed the following microsoft software and everything worked correctly.

    Visual C++ Redistributable Packages for Visual Studio 2013