Page 1 of 1

Changing FilterSQL of inactive TOraTable connects unnecessarily to Oracle

Posted: Sun 18 Sep 2005 20:14
by cis-wurzen
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;

Posted: Mon 19 Sep 2005 12:33
by Alex
We have reproduced your problem and fixed it. This fix will be included in the next ODAC build.