Icon View Incident Report

Serious Serious
Reported By: Chris B
Reported On: 12/7/2010
For: Version 2.04 Build 4
# 3358 Using Locate with OnFilterRecord Can Cause Rows to Not Be Found Properly

I'm working with a filtered dataset in EDB 2.04B4 and have come across an issue where (at first) Locate appeared to fail for no apparent reason. Some simplified code below.

This is the recordset produced:

ProductCode Type
320802 8
320802 8
320802 16
293709 8

Calling ds->Locate("ProductCode", 320802) returns False each time in this case. If filter is removed, Locate works again.

I figured out that Locate happens to find the third record (with Type = 16) and filters it out. It then moves to the next record (with ProductCode = 293709), which does not match the original criteria, so it returns False.

ds->Filtered = true;
ds->OnFilterRecord = MyOnFilterRecord;

void __fastcall TMyForm::MyOnFilterRecord(TDataSet *DataSet, bool &Accept)
{
     Accept = DataSet->FieldByName("Type")->AsInteger != 16;
}



Resolution Resolution
Fixed Problem on 12/10/2010 in version 2.05 build 1


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB LCL Standard with Source
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image