Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Findkey and Filter
Sun, Jul 18 2010 6:50 AMPermanent Link

Pierre du Plessis

Comproware

I just found that Findkey returns true for values that are filtered out.  Is this the intended behavior or a bug?

I use FindKEY to locate a record and then show the Edit window.  With DBISAM, this worked as I intended, but with Elevate DB, it returns true, which means the the edit record contains the incorrect row.

To overcame this, I had to do this:

Change from:
       if FindKey([Px]) then
       begin
To:
       if FindKey([Px]) and (FieldByName('ID').AsInteger=Px) then
       begin

NOTE: The ID in Px exists in the database, but it's a filtered dataset.

Thanks,
Pierre
Mon, Jul 19 2010 8:01 PMPermanent Link

Pierre du Plessis

Comproware

Hello Folks,

Anyone else experiencing this?  Is this intended behaviour?

Many thanks,
Pierre
Wed, Jul 21 2010 5:42 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Pierre,

<< I just found that Findkey returns true for values that are filtered out.
Is this the intended behavior or a bug?

I use FindKEY to locate a record and then show the Edit window.  With
DBISAM, this worked as I intended, but with Elevate DB, it returns true,
which means the the edit record contains the incorrect row. >>

I'll check this out and if it is an issue, it will be fixed in the next
build 18.  If I can't reproduce it, I'll follow up with you here.

--
Tim Young
Elevate Software
www.elevatesoft.com
Fri, Jul 23 2010 9:52 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Pierre,

What version/build are you using ?  I can't replicate this with 2.03 B17:

procedure TForm1.Button1Click(Sender: TObject);
begin
  EDBTable1.Filter:='State=''FL''';
  EDBTable1.Filtered:=True;
  if EDBTable1.FindKey([1354]) then
     Label1.Caption:='Found'
  else
     Label1.Caption:='Not Found';
end;

shows "Not Found" every time, which is correct.

--
Tim Young
Elevate Software
www.elevatesoft.com
Sat, Jul 24 2010 4:32 PMPermanent Link

Pierre du Plessis

Comproware

>> What version/build are you using ?  I can't replicate this with 2.03 B17:

Hi Tim,

I think the problem lies with the fact that I also use the "OnFilter" event.  I use a combination of setting the filter, as well as the OnFilter event.  I'm using the latest build.

Many thanks,
Pierre
Tue, Jul 27 2010 8:45 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Pierre,

<< I think the problem lies with the fact that I also use the "OnFilter"
event.  I use a combination of setting the filter, as well as the OnFilter
event.  I'm using the latest build. >>

Ahh, okay, let me check that out and get back to you.

--
Tim Young
Elevate Software
www.elevatesoft.com
Image