Page 1 of 1
what is the difference between UniQuery1->Active=false; and UniQuery1->Close();
Posted: Wed 04 Sep 2013 06:21
by radomir23
please description difference between
UniQuery1->Close(); and UniQuery1->Active=false;
thank very much
Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();
Posted: Wed 04 Sep 2013 06:45
by AndreyZ
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.
Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();
Posted: Wed 04 Sep 2013 06:53
by radomir23
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
Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();
Posted: Wed 04 Sep 2013 07:28
by AndreyZ
As we do not develop DevExpress components, we cannot answer this question. Please contact the DevExpress support.
Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();
Posted: Wed 04 Sep 2013 08:21
by radomir23
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
Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();
Posted: Wed 04 Sep 2013 09:08
by AndreyZ
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;
Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();
Posted: Wed 04 Sep 2013 09:49
by radomir23
thanks very very good description
B.R Rado
Re: what is the difference between UniQuery1->Active=false; and UniQuery1->Close();
Posted: Wed 04 Sep 2013 09:52
by AndreyZ
Feel free to contact us if you have any further questions about UniDAC.