View Issue Details

IDProjectCategoryView StatusLast Update
0038752LazarusDatabase Componentspublic2021-04-13 17:43
ReporterRussell Crosser Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformPCOSWindows 10 
Summary0038752: DisableControls stops Dataset first, next, connection to Master DB from working
DescriptionHelp about on Lazarus - Lazarus 2.0.10 r63526 FPC 3.2.0 x86_64-win64-win32/win64

I have a master-detail, one master, 2 dependent tables. When I try to traverse the database with the controls disabled, the
dependent tables do not correctly display. As I move through the master records, the details show the records for the
Master record I had highlighted before clicking the button to start.
Steps To ReproduceDataset has 3 tables, Company, Tranch, and Dividend.
Master Query (SQLQuery1Co) has no dataset associated
Master SQL - select * from company
1st and 2nd detail queries (SQLQuery2Tr and SQLQuery3Div) both have dataset set to SQLQuery1Co
1st Detail SQL (SQLQuery2Tr) - select * from Tranch where Company_Link = :Co_id
2nd Detail SQL (SQLQuery3Div) - select * from Dividend where Company_Link = :Co_id
Co_ID is the Primary Key of the Master Table (Company)

I traverse the data in a simple procedure.

while not SQLQuery1Co.EOF do begin
  SQLQuery1Co.First;
  Print fields;
  Show Tranches; // similar logic
  Show Dividends; // similar logic
  SQLQuery1Co.next;
end;
Additional InformationThe details are in the attached program.
The faulty results are in BugResults.txt

Controls disabled: (the grouped lines are all the same)

AAA (Aaaaaa)
     221 Units bought on 1/02/2019 Cost: $2221
     222 Units bought on 1/02/2020 Cost: $2222
     223 Units bought on 1/02/2021 Cost: $2223
       Dividend 1/05/2019 Franked: $112.01 Unfranked: $12.01
       Dividend 2/05/2020 Franked: $112.02 Unfranked: $12.02
       Dividend 3/05/2021 Franked: $112.03 Unfranked: $12.03

BBB (Bbbbbb)
     221 Units bought on 1/02/2019 Cost: $2221
     222 Units bought on 1/02/2020 Cost: $2222
     223 Units bought on 1/02/2021 Cost: $2223
       Dividend 1/05/2019 Franked: $112.01 Unfranked: $12.01
       Dividend 2/05/2020 Franked: $112.02 Unfranked: $12.02
       Dividend 3/05/2021 Franked: $112.03 Unfranked: $12.03

Controls not disabled: (this is the correct data)

AAA (Aaaaaa)
     111 Units bought on 1/01/2019 Cost: $1111
     122 Units bought on 1/01/2020 Cost: $1112
     113 Units bought on 1/01/2021 Cost: $1113
       Dividend 1/04/2019 Franked: $111.01 Unfranked: $11.01
       Dividend 2/04/2020 Franked: $111.02 Unfranked: $11.02
       Dividend 3/04/2021 Franked: $111.03 Unfranked: $11.03

BBB (Bbbbbb)
     221 Units bought on 1/02/2019 Cost: $2221
     222 Units bought on 1/02/2020 Cost: $2222
     223 Units bought on 1/02/2021 Cost: $2223
       Dividend 1/05/2019 Franked: $112.01 Unfranked: $12.01
       Dividend 2/05/2020 Franked: $112.02 Unfranked: $12.02
       Dividend 3/05/2021 Franked: $112.03 Unfranked: $12.03


TagsNo tags attached.
Fixed in Revision
LazTarget
Widgetset
Attached Files

Activities

Russell Crosser

2021-04-13 17:36

reporter  

Bugs.zip (207,239 bytes)

Russell Crosser

2021-04-13 17:43

reporter   ~0130352

I neglected to mention that each of the tables (SQLQueries) is displayed in a DBGrid. The controls are disabled to stop the grids from cycling through the records while producing the report. I would probably cope with this by hiding the grids while the report is written. But it definitely shouldn't happen like this.

Issue History

Date Modified Username Field Change
2021-04-13 17:36 Russell Crosser New Issue
2021-04-13 17:36 Russell Crosser File Added: Bugs.zip
2021-04-13 17:43 Russell Crosser Note Added: 0130352