dbExpress 6.0.1.0 Oracle with Delphi XE3

dbExpress 6.0.1.0 Oracle with Delphi XE3

Postby ThomasS » Wed 19 Dec 2012 14:22

Hi,

I opened your dbExpress demo named "Query" (Win32) and tried to connect to my Oracle DB.
It fails telling me in german language
"DBX-Fehler: Der Treiber konnte nicht korrekt initialisiert werden. Die Client-Bibliothek könnte fehlen ...etc..."
which means in english
"DBX-Error: The driver cannot be properly initialized. The Client-library could be missing ...etc..."

Setup is:
Win7 64bit german
dbExpress= 6.0.1.0
Delphi XE3 german
Oracle 11
SQLNet8 (because some progs need BDE)

Your readme.html tells me to use dbexpoda.dll. This DLL is located in C:\Windows\system32\


The component TSQLConnection of old Borland Delphi 2006 provided properies
GetDriverFunc=getSQLDriverORA
LibraryName=dbexpoda30.dll
VendorLib=OCI.DLL

Those properties are missing in XE3's TSQLConnection. There are no entries in the object inspector.

My question now is: How do I have to configure DbExpress to get your demo and my progs running?

TIA
Thomas
ThomasS
 
Posts: 3
Joined: Wed 19 Dec 2012 13:51

Re: dbExpress 6.0.1.0 Oracle with Delphi XE3

Postby AlexP » Thu 20 Dec 2012 14:31

Hello,

In XE3 these parameters were removed from Object Inspector. Now, these parameters can be set using the Params property in both Object Inspector and code:

Code: Select all
SQLConnection1.Params.Values['LibraryName'] := 'dbexpoda40.dll';
SQLConnection1.Params.Values['VendorLib'] := 'OCI.dll';
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: dbExpress 6.0.1.0 Oracle with Delphi XE3

Postby ThomasS » Wed 02 Jan 2013 19:50

Happy New Year,

I now updated to your Xmas release of dbExpress 6.1.2 for Oracle.
But I still cannot connect your Win32 demo named "Query" to my database.

Your readme.html says for RAD studio 2007 and higher dbexpoda40.dll should be used.
Your installation has put dbexpoda40.dll into C:\windows\system32\

My TSQLConnection params are as follows:

Code: Select all
object SQLConnection: TSQLConnection
    ConnectionName = 'Devart Oracle'
    DriverName = 'DevartOracle'
    GetDriverFunc = 'getSQLDriverORA'
    LibraryName = 'dbexpoda40.dll'      <==== I did change that
    Params.Strings = (
      'BlobSize=-1'
      'DataBase=MYDATABASE.world'       <==== I did change that
      'DriverName=DevartOracle'
      'ErrorResourceFile='
      'LocaleCode=0000'
      'Password=tiger'
      'Oracle TransIsolation=ReadCommitted'
      'User_Name=scott')
    VendorLib = 'OCI.DLL'
    Left = 344
    Top = 40
  end


When I try to connect the TSQLConnection component I get an ORA-06413 error.
Searching the Web leads to a lot of pages saying ORA-06413 is caused by
invalid characters in path names like "program files (x86)"

Now I've uninstalled dbExpress and re-installed it on
C:\Devart\Dbx\Oracle...

Oracle client was installed on
C:\oracle...

I'm still getting ORA-06413 error.

TNS itself seems to work properly, because if I set 'DataBase=MYBUG.world' I receive
an ORA-12154 error (TNS:could not resolve the connect identifier specified).
"TNSPING MYDATABASE.world" run in a DOS box returns OK.
Another program successfully uses MYDATABASE.world for reading data.

Does your Win32 demo connect on your Win7 64 bit system?
Did you install Delphi XE3 on C:\program files (x86)\delphi... ?
Any other hints or advice?

TIA
ThomasS
 
Posts: 3
Joined: Wed 19 Dec 2012 13:51

Re: dbExpress 6.0.1.0 Oracle with Delphi XE3

Postby AlexP » Thu 03 Jan 2013 09:49

Hello,

Below is an example of a console application for establishing connection to Oracle with the help of our dbExpress driver, change the required options (DataBase, User_Namem, etc.) and try to run this example.
P.S. Please specify your exact version of Oracle

Code: Select all
program Project2;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils,
  Data.DB,
  Data.SqlExpr,
  DBXDevartOracle;

var
  SQLConnection: TSQLConnection;
begin
  SQLConnection := TSQLConnection.Create(nil);
  try
    SQLConnection.ConnectionName := 'Devart Oracle';
    SQLConnection.DriverName := 'DevartOracle';
    SQLConnection.LoginPrompt := False;
    SQLConnection.Params.Values['LibraryName'] := 'dbexpoda40.dll';
    SQLConnection.Params.Values['VendorLib'] := 'OCI.DLL';
    SQLConnection.Params.Values['User_Name'] := 'scott';
    SQLConnection.Params.Values['Password'] := 'tiger';
    SQLConnection.Params.Values['DataBase'] := 'ORCL';
    try
      SQLConnection.Connected := True;
      Writeln('Connected');
    Except
      on e: Exception do
        Writeln(e.Message);
    end;
  finally
    SQLConnection.Free;
    Readln;
  end;
end.
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: dbExpress 6.0.1.0 Oracle with Delphi XE3

Postby ThomasS » Wed 09 Jan 2013 13:58

Thank you for that useful example code.
I can use that code to connect to my DB.
I had forgotten to change the library path to C:\Devart\Dbx\Oracle\Lib\Delphi17\Win32 in Delphi options.

Additionally your demo 'QUERY' now connects to my DB and successfully reads data.
For XE3 I just had to add:
Code: Select all
{$IFDEF VER240}
  {$DEFINE DRIVERUNIT}
{$ENDIF}


Regards,
Thomas
ThomasS
 
Posts: 3
Joined: Wed 19 Dec 2012 13:51


Return to dbExpress driver for Oracle