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:
try
Oracle_Conn.DatabaseName:=DatabaseNameEdit.Text;
Oracle_Conn.HostName:=HostEnteredEdit.Text+':'+HostPortEnteredEdit.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