Recent

Author Topic: Problem with TDBChartSource in tadbsource.pas  (Read 1062 times)

Lutz Mändle

  • Jr. Member
  • **
  • Posts: 83
Problem with TDBChartSource in tadbsource.pas
« on: January 28, 2025, 09:49:49 pm »
There is a probability to have an unbalanced call to FDataLink.Dataset.DisableControls/FDataLink.Dataset.EnableControls in the methods TDbChartSource.BeforeDraw and TDbChartSource.AfterDraw respectively.

In the method TDbChartSource.AfterDraw the call to FDataLink.Dataset.EnableControls is omitted, if the dataset is closed during a refresh cycle.

Then all data aware components linked to this dataset don't work anymore until the program is restartet.

The fix is to exchange the lines 149 and 150 in the source file.
Here is the corrected method:
Code: Pascal  [Select][+][-]
  1. procedure TDbChartSource.AfterDraw;
  2. begin
  3.   inherited AfterDraw;
  4.   try
  5.     FDataLink.Dataset.EnableControls;
  6.     if not FDataLink.Active or (FBookmark = nil) then exit;
  7.     FDataLink.DataSet.GotoBookmark(FBookmark);
  8.     FDataLink.DataSet.FreeBookmark(FBookmark);
  9.   finally
  10.     FBookmark := nil;
  11.     VLockedDatasets.Remove(FDataLink.DataSet);
  12.   end;
  13. end;
  14.  

wp

  • Hero Member
  • *****
  • Posts: 13268
Re: Problem with TDBChartSource in tadbsource.pas
« Reply #1 on: January 29, 2025, 01:11:28 am »
Committed, merged to Fixes_3 and Fixes_4. Thanks.
« Last Edit: January 29, 2025, 01:13:03 am by wp »

 

TinyPortal © 2005-2018