"Datasource makes a circular link" exception when assign datasource to nil
Posted: 01.08.2022, 09:04
Hello,
(this is my second post with same subject and topic. First one is not accepted I guess)
When assign {TZQuery}ZQuery2.DataSource :=nil or pick (none) from IDE, I get "Datasource makes a circular link" exception.
On a datamodule :
Put two TZQuery as ZQuery1 and ZQuery2
Put two TDataSource as DataSource1 and DataSource2
Keep the queries' SQLs empty.
with IDE make these connections :
DataSource1.DataSet :=ZQuery1;
DataSource2.DataSet :=ZQuery2;
with IDE make this connection :
ZQuery2.DataSource :=DataSource1;
then with IDE or programmatically, try to remove connection :
get the exception
(this is my second post with same subject and topic. First one is not accepted I guess)
When assign {TZQuery}ZQuery2.DataSource :=nil or pick (none) from IDE, I get "Datasource makes a circular link" exception.
On a datamodule :
Put two TZQuery as ZQuery1 and ZQuery2
Put two TDataSource as DataSource1 and DataSource2
Keep the queries' SQLs empty.
with IDE make these connections :
DataSource1.DataSet :=ZQuery1;
DataSource2.DataSet :=ZQuery2;
with IDE make this connection :
ZQuery2.DataSource :=DataSource1;
then with IDE or programmatically, try to remove connection :
get the exception
{ZAbstractRODataSet.pas}procedure TZAbstractRODataset.SetDataSource(Value: TDataSource); begin {$IFNDEF FPC} if IsLinkedTo(Value) then {$ELSE} if Value.IsLinkedTo(Self) then {$ENDIF} raise EZDatabaseError.Create(SCircularLink); DataLink.DataSource := Value; end;