Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Incident Reports » Incident Reports Reported for Version 3.11 » View Incident Report |
Serious |
Reported By: Rich Walker Reported On: 7/11/2002 For: Version 3.11 Build 1 |
procedure TForm1.Button1Click(Sender: TObject); var tot1,tot2 : Currency; begin // First, with a query qryTemp17.Close; qryTemp17.DatabaseName := ExtractFilePath(Application.ExeName); qryTemp17.SQL.Clear; qryTemp17.SQL.Add('select Amount from "Temp17"'); tot1 := 0; qryTemp17.Open; try qryTemp17.First; qryTemp17.BlockReadSize := 100; while not qryTemp17.Eof do begin tot1 := tot1 + qryTemp17.FieldByName('Amount').AsCurrency; qryTemp17.Next; end; qryTemp17.BlockReadSize := 0; finally qryTemp17.Close; end; tot2 := 0; qryTemp17.Open; try qryTemp17.First; while not qryTemp17.Eof do begin tot2 := tot2 + qryTemp17.FieldByName('Amount').AsCurrency; qryTemp17.Next; end; finally qryTemp17.Close; end; ShowMessageFmt('Using a TDBISAMQuery:'#13#10+ 'tot1 (BlockReadSize=100): %m'#13#10+ 'tot2 (BlockReadSize=0): %m'#13#10#13#10+ 'Why are these amounts different?',[tot1,tot2]); // Now let's try the same logic with a table tblTemp17.Close; tblTemp17.DatabaseName := ExtractFilePath(Application.ExeName); tblTemp17.TableName := 'Temp17'; tot1 := 0; tblTemp17.Open; try tblTemp17.First; tblTemp17.BlockReadSize := 100; while not tblTemp17.Eof do begin tot1 := tot1 + tblTemp17.FieldByName('Amount').AsCurrency; tblTemp17.Next; end; tblTemp17.BlockReadSize := 0; finally tblTemp17.Close; end; tot2 := 0; tblTemp17.Open; try tblTemp17.First; while not tblTemp17.Eof do begin tot2 := tot2 + tblTemp17.FieldByName('Amount').AsCurrency; tblTemp17.Next; end; finally tblTemp17.Close; end; ShowMessageFmt('Using a TDBISAMTable:'#13#10+ 'tot1 (BlockReadSize=100): %m'#13#10+ 'tot2 (BlockReadSize=0): %m'#13#10#13#10+ 'Why are these amounts different?',[tot1,tot2]); end;
This web page was last updated on Wednesday, October 30, 2024 at 11:41 AM | Privacy PolicySite Map © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |