delphi 6 and devart dbx driver

delphi 6 and devart dbx driver

Postby marcojk » Fri 30 Mar 2012 08:20

I've to modify an old application written with delphi 6.0. The application originally worked with an interbase rdbms but now i've to use the Oracle 10g xe rdbms. I've tried a lot with the trial version of Your driver but still i'm not able to have a connection. Can you help me? I've to use a normal TSqlConnection or i've to use the TCRSqlConnection? How i've to set the params?
Thanks in advance for Your help. I'm getting really crazy!! :shock:

Marco.
marcojk
 
Posts: 2
Joined: Fri 30 Mar 2012 08:08

Postby AlexP » Fri 30 Mar 2012 11:11

Hello,

Below is the code demonstrating the Oracle connection in two modes: 1 - using the Oracle client, 2 - using the direct mode. In the specified code, set your data (Login, password, HOST, PORT, SID) and try to connect to Oracle. If any problems occur, please contact us once again.

Code: Select all
var
  SQLConnection: TSQLConnection;
begin
  SQLConnection := TSQLConnection.Create(nil);
  try
    SQLConnection.ConnectionName := 'Devart Oracle';
    SQLConnection.DriverName := 'DevartOracle';
    SQLConnection.GetDriverFunc := 'getSQLDriverORA';
    SQLConnection.LibraryName := 'dbexpoda.dll';
    SQLConnection.VendorLib := 'OCI.DLL';
    SQLConnection.Params.Values['DataBase'] := 'SID';
    SQLConnection.Params.Values['User_Name'] := 'login';
    SQLConnection.Params.Values['Password'] := 'password';
    SQLConnection.LoginPrompt := false;
    try
      SQLConnection.Connected;
    except
      on e: Exception do
        ShowMessage(e.message);
    end;
  finally
    SQLConnection.Free;
  end;


  SQLConnection := TSQLConnection.Create(nil);
  try
    SQLConnection.ConnectionName := 'Devart Oracle Direct';
    SQLConnection.DriverName := 'DevartOracleDirect';
    SQLConnection.GetDriverFunc := 'getSQLDriverORADirect';
    SQLConnection.LibraryName := 'dbexpoda.dll';
    SQLConnection.VendorLib := 'dbexpoda.dll';
    SQLConnection.Params.Values['DataBase'] := 'host:port:sid';
    SQLConnection.Params.Values['User_Name'] := 'login';
    SQLConnection.Params.Values['Password'] := 'password';
    SQLConnection.LoginPrompt := false;
    try
      SQLConnection.Connected;
    except
      on e: Exception do
        ShowMessage(e.message);
    end;
  finally
    SQLConnection.Free;
  end;
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Delphi 6 etc.

Postby marcojk » Mon 02 Apr 2012 09:53

:D Thanks a lot for Your help. It works now. I can afford the job.

regards

Marco.
marcojk
 
Posts: 2
Joined: Fri 30 Mar 2012 08:08

Postby AlexP » Mon 02 Apr 2012 10:47

Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35


Return to dbExpress driver for Oracle