what is the difference between UniQuery1->Active=false; and UniQuery1->Close();

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
radomir23
Posts: 18
Joined: Thu 19 Apr 2012 06:04

what is the difference between UniQuery1->Active=false; and UniQuery1->Close();

Post by radomir23 » Wed 04 Sep 2013 06:21

please description difference between

UniQuery1->Close(); and UniQuery1->Active=false;

thank very much

AndreyZ

Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();

Post by AndreyZ » Wed 04 Sep 2013 06:45

There is no difference. The Close method of the TDataSet class just sets the Active property to False. You can take a look at the TDataSet.Close method in the DB unit.

radomir23
Posts: 18
Joined: Thu 19 Apr 2012 06:04

Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();

Post by radomir23 » Wed 04 Sep 2013 06:53

thak you very very much

can you help

i use devexpress /tcxgrid/ and unidac

i muss always this procedure

cxGridTaskDBTableView1->DataController->CreateAllItems();

when change in uniquery sql statement /in dbgrid is automatic/


very much

B.R. Rado

AndreyZ

Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();

Post by AndreyZ » Wed 04 Sep 2013 07:28

As we do not develop DevExpress components, we cannot answer this question. Please contact the DevExpress support.

radomir23
Posts: 18
Joined: Thu 19 Apr 2012 06:04

Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();

Post by radomir23 » Wed 04 Sep 2013 08:21

thanks very much

one question

when i change sql statement i muss always UniQuery1->Close(); ?

see
UniQuery1->Close();
UniQuery1->SQL->Text=L"SELECT * FROM format";
UniQuery1->Open();

UniQuery1->Close();
UniQuery1->SQL->Text=L"SELECT * FROM glob";
UniQuery1->Open();

UniQuery1->Close();
UniQuery1->SQL->Text=L"SELECT * FROM nemes";
UniQuery1->Open();



or without UniQuery1->Close();

thanks

AndreyZ

Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();

Post by AndreyZ » Wed 04 Sep 2013 09:08

You do not need to close TUniQuery when changing SQL statement. TUniQuery is automatically closed when SQL statement is changed. Here is a code example that demonstrates this behaviour:

Code: Select all

begin
  UniQuery1.SQL.Text := 'select * from table1';
  UniQuery1.Open;
  ShowMessage(BoolToStr(UniQuery1.Active, True)); // shows True
  UniQuery1.SQL.Text := 'select * from table2';
  ShowMessage(BoolToStr(UniQuery1.Active, True)); // shows False
  UniQuery1.Open;
end;

radomir23
Posts: 18
Joined: Thu 19 Apr 2012 06:04

Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();

Post by radomir23 » Wed 04 Sep 2013 09:49

thanks very very good description

B.R Rado

AndreyZ

Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();

Post by AndreyZ » Wed 04 Sep 2013 09:52

Feel free to contact us if you have any further questions about UniDAC.

Post Reply