Page 1 of 1

Whether should TUniQuery clear properties at SQL change?

Posted: Fri 22 Apr 2011 10:08
by Alexander_73
I create an object of TUniQuery, I set properties:

Code: Select all

var
   Q : TUniQuery;
begin
  Q:=TUniQuery.Create(nil);
  try
    Q.Connection:=MSAcsConnect;
    Q.SQL.Text:='SELECT * FROM Table1';
    Q.UpdatingTable:='Table1';
    Q.KeyFields:='Table1ID';
    Q.Open;
    try
      Q.Insert;
       ...
   finally
     Q.Close
   end;
   Q.SQL.Text:='SELECT * FROM Table2';
   // Why on this place do not to clear properties UpdatingTable&KeyFields, the query SQL is changed?
    ....
  finally
    Q.Free
 end
end;
Why on selected place do not to clear properties UpdatingTable&KeyFields automatically, if the query SQL is changed?

Posted: Fri 22 Apr 2011 12:03
by AlexP
Hello,

We don't clear any properties that are set by user.
You should manually clear all properties that you have changed.

Posted: Fri 22 Apr 2011 12:13
by Alexander_73
It is a pity :). Thanks.