TOraQuery.Connection Property

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wittenburg
Posts: 2
Joined: Mon 24 Sep 2012 11:16
Location: Germany

TOraQuery.Connection Property

Post by wittenburg » Mon 24 Sep 2012 11:58

Hello,

we are switching from ADO to ODAC and i want to know what's the difference between TOraQuery.Connection and TOraQuery.Session property or rather if they are equal, so there is no disadvantage to use the Component like the following code:

Code: Select all

{$IFDEF ODAC}
  GlobalDataConnection: TOraSession;
{$ELSE}
  GlobalDataConnection: TADOConnection;
{$ENDIF}

Code: Select all

{$IFDEF ODAC}
  qryData := TORAQuery.Create(self);
{$ELSE}
  qryData := TADOQuery.Create(self);
{$ENDIF}
  qryData.Connection := GlobalDataConnection;

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TOraQuery.Connection Property

Post by AlexP » Mon 24 Sep 2012 13:18

hello,

The Connection and Session properties of TOraQuery are identical, and you can use any of them. The Connection property was added for compatibility when migrating from other components to ODAC. The code you provided will work correctly.

Post Reply