Lazarus 1.6.2 64bit x TOracleConnection lazarus / 16-Databases ---------------------------------------------------------------------- clcoelho · 2016-12-14 14:30 Dear Sirs, Lazarus 1.6.2 64bit doesn't support SQLdb TOracleConnection? I saw an old post about this: http://forum.lazarus.freepascal.org/index.php?topic=21352.0 Can anyone tell me if it is correct? This problema persists at Lazarus 1.6.2? If I wanna use Oracle with sqldb, I must install Lazarus 32bit? Thanks ---------------------------------------------------------------------- LacaK · 2016-12-14 18:43 Quote from: clcoelho on December 14, 2016, 03:30:33 pmLazarus 1.6.2 64bit doesn't support SQLdb TOracleConnection? Can anyone tell me if it is correct? This problema persists at Lazarus 1.6.2? Yes Quote from: clcoelho on December 14, 2016, 03:30:33 pmIf I wanna use Oracle with sqldb, I must install Lazarus 32bit? Yes There is problem that nobody have tested Oracle OCI in x64 (I do not know if Oracle provides it for x64) ---------------------------------------------------------------------- DanishMale · 2017-01-23 02:10 I found this article describing how, perhaps, a solution could look like: http://nobytes.blogspot.de/2014/04/how-to-use-toracleconnection- under.html  I will test it during the next few days and come back with some info. ---------------------------------------------------------------------- DanishMale · 2017-01-24 00:23 I have now tested the solution and can connect and retrieve the version number of the Oracle database. These are the steps I have followed (See previous post for origin of solution): he solution The solution consists of three steps. Step 1: Uninstall the Oracle Client 11g but back up your configuration files like TNSNAMES.ORA, LOGIN.SQL, GLOGIN.SQL. Then remove the old paths from the Windows Environment Variable PATH. Step 2: Download and install the Oracle Instant Client 12.1c and Oracle SQL Plus for Win64. Install both programs into the same folder and put the configuration files there again. No put the path of the new client location into the PATH Variable again. Test to connect to your database with SQL*Plus. If this works, you are fine. Step 3: Enabling the TOracleConnection in your Lazarus installation again. You have to go to the "Package" menu entry. Select "Open loaded Package". In the dialog you select the package "sqldblaz". Now click "add" and go to the tab "Add files". Then browse to the file "oracleconnection.pp" under "[Lazarus directory]\fpc\2.6.2\source\packages\fcl-db\src\sqldb\oracle" and add it to the package. The next step is, to change the file "registersqldb". Search for the first occurrence of {$DEFINE HASORACLECONNECTION} It's in an {$IFNDEF WIN64} section. You need to move it out there. I moved it under the line {$DEFINE HASSYBASECONNECTION} . Then save the file, compile the package via "compile" button. If it compiled successfully, click the button "use" and then "install". Now your Lazarus should be build new. After starting the IDE again, you should see the icon Icon of TOracleConnection again in the "SQLdb" tab. This is configuration of the Connection: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i          try            Oracle_Conn.DatabaseName:=DatabaseNameEdit.Text;          Oracle_Conn.HostName:=HostEnteredEdit.Text+':'+HostPortEnteredEdi t.Text+'/'+DatabaseNameEdit.Text;            Oracle_Conn.Password:=DatabasePWEdit.Text;            Oracle_Conn.UserName:=DatabaseUserEdit.Text;            Oracle_Conn.Transaction:=SQL_Transaction;            SQL_Query.Database:=Oracle_Conn;            SQL_Query.Transaction:=SQL_Transaction;            SQL_Transaction.Database:=Oracle_Conn;            Oracle_conn.Connected := True;            if Oracle_conn.Connected then            begin              SQL_Query.SQL.Clear;              SQL_Query.SQL.Add('SELECT version FROM v$instance');              SQL_Query.Prepare;              SQL_Query.Open;              ShowMessage('Active Database : Oracle '+SQL_Query['version']);            SQL_Query.Close;              Oracle_conn.Connected := False;          end;        except          on E: EDatabaseError do          begin             ShowMessage('DB ERROR: ' + E.message);          end;          on E: Exception do          begin             ShowMessage('ERROR: ' + E.message);          end;        end;  // Excepted output: 12.1.0.2.0 //Received output: 12.1.0.2.0  and of course the instant client library basic 12.1.0.2.0 for Windows x64 in my projects folder, which I have downloaded from Oracle download page http://www.oracle.com/technetwork/topics/winx64soft-089540.html ---------------------------------------------------------------------- LacaK · 2017-02-02 07:54 If you can confirm, that TOracleConnection works also under x64 with x64 client then please report bug in bugtracker asking to enable TOracleConnection for x64 target. ---------------------------------------------------------------------- DanishMale · 2017-02-02 16:14 I can only confirm it works with Oracle 12 in x64 mode of both database and program. I can NOT confirm it will work with other versions of Oracle. ---------------------------------------------------------------------- LacaK · 2017-02-09 11:45 Fixed http://bugs.freepascal.org/view.php?id=31343 ---------------------------------------------------------------------- scalino · 2019-09-27 10:38 Quote from: DanishMale on February 02, 2017, 05:14:29 pmI can only confirm it works with Oracle 12 in x64 mode of both database and program. I can NOT confirm it will work with other versions of Oracle. I followed your advice and I can confirm it also works with a 11.2g 64bit client (installed in addition of a pre-existent 32 bits 11.2g client in a separate directory), granted that I don't use the .hostname property of the Oracle Connection, and only use .DatabaseName with the TNS name (& granted your oracle client's files/path architecture is properly done). Thanks to you