Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Circular links
Sat, May 19 2007 9:02 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

Why, with the following sql

SELECT
*
FROM
"MyMDB"."Transactions"  AS "MyMDBTransactions"
WHERE
"MyMDBTransactions"."_fkAccounts" = 1

do I get

'Circular data links are not allowed'

and then it executes anyway?????

Roy Lambert
Sat, May 19 2007 2:04 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


I think its me. I removed the {$D-} I'd added to edbcomps and found

procedure TEDBQuery.SetDataSource(Value: TDataSource);
begin
  if IsLinkedTo(Value) then
     DatabaseError(SCircularDataLink);
  FDataLink.DataSource:=Value;
end;

My code is

procedure TReportsForm.AdvGlowButton1Click(Sender: TObject);
begin
Reporter.DataSource := nil;<<<<<<<<<<<<<<<<<<<<<<<<
Reporter.SQL.Text := nlhSQG1.SQLStr;
Reporter.ExecSQL;
Reporter.DataSource := dsReporter;<<<<<<<<<<<<<<<<<<<<
Report.AutoFitColumns;
end;

If I comment the two marked lines everything's fine. I cocked up since I should have been doing it the other way and clearing/setting the dataset for the datasource. I'm still confused as to why it gives a warning and then just continues though.


Roy Lambert
Image