Page 1 of 1

"Datasource makes a circular link" exception when assign datasource to nil

Posted: 01.08.2022, 09:04
by omurolmez
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
{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;

Re: "Datasource makes a circular link" exception when assign datasource to nil

Posted: 02.08.2022, 11:42
by marsupilami
Hello :)
omurolmez wrote: 01.08.2022, 09:04 (this is my second post with same subject and topic. First one is not accepted I guess)
I am sorry - I didn't get to approving new posts for some days. Your other post (viewtopic.php?f=50&t=165631) has been approved. I am locking this thread in favor of the other thread.

Best regards,

Jan