Icon View Incident Report

Minor Minor
Reported By: Martijn Mulder
Reported On: 5/2/2005
For: Version 4.19 Build 1
# 2040 Emptying a Table and Then Setting a Filter Causes Incorrect RecordCount When Exclusive=True

I've a problem with a DBISAMTable. I created an Memory Table with 3 fields. I have a filter on one of those fields. There are 2 records wich are selected with the filter. When I empty the table , append a new record and put the filter back on. The physicalrecordcount is 1 but the filteredrecordcount and recordcount are both 3.

procedure TForm2.BitBtn1Click(Sender: TObject);
 
var
 MemTable: TDBISAMTable;
 
begin
  MemTable := TDBISAMTable.Create(DataOverzicht);
 
  MemTable.FieldDefs.Add('OWINKEY', ftString, 8, True);
  MemTable.FieldDefs.Add('OWINVolgNr', ftInteger, 0, True);
  MemTable.FieldDefs.Add('MaatschappijOWINKEY', ftString, 8, True);
 
  MemTable.DatabaseName := 'MEMORY';
  MemTable.TableName := 'Test.dat';
 
  MemTable.CreateTable;
 
  MemTable.Exclusive := True;
 
  MemTable.Open;
 
  MemTable.Append;
  MemTable.FieldByName('OWINKey').AsString := 'C      1';
  MemTable.FieldByName('OWINVolgnr').AsInteger := 2000;
  MemTable.FieldByName('MaatschappijOWINKey').AsString := 'M   S049';
  MemTable.Post;
 
  MemTable.Append;
  MemTable.FieldByName('OWINKey').AsString := 'C      1';
  MemTable.FieldByName('OWINVolgnr').AsInteger := 3000;
  MemTable.FieldByName('MaatschappijOWINKey').AsString := 'M   S049';
  MemTable.Post;
 
  MemTable.Append;
  MemTable.FieldByName('OWINKey').AsString := 'C      1';
  MemTable.FieldByName('OWINVolgnr').AsInteger := 1000;
  MemTable.FieldByName('MaatschappijOWINKey').AsString := 'M   A059';
  MemTable.Post;
 
  MemTable.Append;
  MemTable.FieldByName('OWINKey').AsString := 'C      1';
  MemTable.FieldByName('OWINVolgnr').AsInteger := 1000;
  MemTable.FieldByName('MaatschappijOWINKey').AsString := 'M   A059';
  MemTable.Post;
 
  MemTable.Filter :=  'MAATSCHAPPIJOWINKEY=''M   A059''';
  MemTable.Filtered := True;
  ShowMessage('After 1ste filter: ' + IntToStr(MemTable.RecordCount));
  MemTable.Filtered := false;
 
  MemTable.EmptyTable;
 
  MemTable.Append;
  MemTable.FieldByName('OWINKey').AsString := 'C     11';
  MemTable.FieldByName('OWINVolgnr').AsInteger := 1000;
  MemTable.FieldByName('MaatschappijOWINKey').AsString := 'M   S049';
  MemTable.Post;
 
  MemTable.Filter :=  'MAATSCHAPPIJOWINKEY=''M   A059''';
  MemTable.Filtered := True;
  Showmessage('After 2de filter:'+
              IntToStr(MemTable.PhysicalRecordCount)+'-'+
              IntToStr(MemTable.RecordCount)+'-'+
              IntToStr(MemTable.FilterRecordCount));

end;



Comments Comments and Workarounds
This problem only appears when Exclusive=True and the table is not closed or refreshed between the EmptyTable and the filter being set. Also, this problem was originally thought to be resolved in 4.20 Build 1, but was not due to an incorrect test application in the automated test framework that caused the problem to slip through.


Resolution Resolution
Fixed Problem on 6/2/2005 in version 4.21 build 1


Products Affected Products Affected
DBISAM VCL Client-Server
DBISAM VCL Client-Server with Source
DBISAM VCL Standard
DBISAM VCL Standard with Source

Image