Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread DataSet Find Not finding Record
Wed, Oct 1 2014 7:46 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

I have the following code in my project:

with EstimateHeaderTable do
begin
  First();
  while (not EOF) do
  begin
    LogOutput('Recno : ' + IntToStr(Columns['Recno'].AsInteger));
    Next();
  end;
  end;

EstimateHeaderTable.Columns['Recno'].SortDirection := sdAscending;
EstimateHeaderTable.SortCaseInsensitive := true;
EstimateHeaderTable.Sort;
EstimateHeaderTable.InitFind;

EstimateHeaderTable.Columns['Recno'].AsInteger := 19;
if EstimateHeaderTable.Find(true,true) then
  EstimateNameEdit.Text := EstimateHeaderTable.Columns['Name'].AsString
else
  EstimateNameEdit.Text := 'Not Found';


The LogOutput produces two numbers as expected:

19
21

So why does the Find not see the Row with Recno = 19?

Chris Holland
Wed, Oct 1 2014 8:26 AMPermanent Link

Walter Matte

Tactical Business Corporation

Chris:

Did you try:

if EstimateHeaderTable.Find(false,true) then
.....


Walter
Wed, Oct 1 2014 8:54 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Yes, tried both options.

On 01/10/2014 13:26, Walter Matte wrote:
> Chris:
>
> Did you try:
>
> if EstimateHeaderTable.Find(false,true) then
> ....
>
>
> Walter
>
Wed, Oct 1 2014 8:59 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

It appears to work if I use:

if EstimateHeaderTable.Find(false,false) then

So the CaseInsensitive option appears to stop the Integer search from
working!

Chris Holland.


On 01/10/2014 13:54, Chris Holland wrote:
> Yes, tried both options.
>
> On 01/10/2014 13:26, Walter Matte wrote:
>> Chris:
>>
>> Did you try:
>>
>> if EstimateHeaderTable.Find(false,true) then
>> ....
>>
>>
>> Walter
>>
Image