Changing FilterSQL of inactive TOraTable connects unnecessarily to Oracle

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
cis-wurzen
Posts: 75
Joined: Tue 04 Jan 2005 10:26

Changing FilterSQL of inactive TOraTable connects unnecessarily to Oracle

Post by cis-wurzen » Sun 18 Sep 2005 20:14

Changing FilterSQL of inactive TOraTable connects unnecessarily to Oracle.

Steps to reproduce:

1. Create a new application.

2. Drop one TOraSession, TSmartQuery, TOraTable, TButton at Form1.

3. Doubleclick one Button1 and fill Button1Click as follows (use copy
and paste :wink: )

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  with OraSession1 do
  begin
    Username := 'username';     // does not matter
    Password := 'password';     // does not matter
    Server   := 'notexisting';  // should not exist!
  end;
  with OraTable1 do
  begin
    Session   := OraSession1;
    TableName := 'testtable';   // does not matter
  end;
  with SmartQuery1 do
  begin
    Session := OraSession1;
    SQL.Clear;
    SQL.Add('select * from testtable1');
  end;

  SmartQuery1.FilterSQL := 'field1 = 1';
  // works, because no connection is established


  OraTable1.FilterSQL   := 'field1 = 1';
  // raises an exception (ORA-12154 of course),
  // because OraTable1 wants to connect to
  // oracle although OraTable1 is not active!
end;

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Mon 19 Sep 2005 12:33

We have reproduced your problem and fixed it. This fix will be included in the next ODAC build.

Post Reply