Lazarus

Programming => Databases => Topic started by: bill0287 on April 23, 2015, 08:40:33 pm

Title: tDBF filters not working (Laz 1.4)
Post by: bill0287 on April 23, 2015, 08:40:33 pm
This tDbf filter statement does not seem to be working in my app anymore. I use a combobox to choose a field from the dbf, then use a dblookupcombox to display the values of that field, and then use those two items to feed the filter statement.  It used to work, now it doesn't. Can you see anything wrong here?

Neither one of the filter statements show below are working in Laz1.4, but worked/work fine in 1.2.6. 

Can anyone test in 1.4 and see if it works for them?

Code: [Select]
procedure TForm1.Button1Click(Sender: TObject);
begin
  with dbf1 do begin
      // Filter := ComboBox1.Text + '=' + QuotedSTR(DBLookupComboBox1.Text);
      Filter := ComboBox1.Text + '=' + AnsiQuotedSTR(DBLookupComboBox1.Text,'"');
      Filtered := True;
      end
end;

Attached is a simple project showing this.
Title: Re: tDBF filters not working (Laz 1.4)
Post by: LacaK on April 24, 2015, 08:13:11 am
I guess, that problem will not be inside TDBF, because TDBF is part of FCL (i.e. FreePascal) and version of FPC is same for Lazarus 1.2 and 1.4.

May be that DBLookupComboBox changed ?
Title: Re: tDBF filters not working (Laz 1.4)
Post by: bill0287 on April 24, 2015, 09:57:27 pm
Filed a bug:

http://bugs.freepascal.org/view.php?id=27959
Title: Re: tDBF filters not working (Laz 1.4)
Post by: miab3 on April 24, 2015, 11:42:11 pm
Filed a bug:

http://bugs.freepascal.org/view.php?id=27959

You are using DBLookupComboBox badly.
Add a second ComboBox.

Michal
Title: Re: tDBF filters not working (Laz 1.4)
Post by: bill0287 on April 25, 2015, 01:03:09 am
That may be true, but I am curious, since all I want is the text value in the DBLookupComboBox, why would using a ComboBox make a difference (since it does work as coded with 1.2.6)?
Title: Re: tDBF filters not working (Laz 1.4)
Post by: LacaK on April 25, 2015, 09:55:26 am
IMO there is any problem in DBLookupComboBox.
When TDBF dataset becomes Filtered then DBLookupComboBox is notified about change of his ListSource Dataset and should refresh own Items. But it freezes ...
Title: Re: tDBF filters not working (Laz 1.4)
Post by: bill0287 on April 30, 2015, 11:45:17 pm
Is there any hope of this getting fixed/released any time soon?
Title: Re: tDBF filters not working (Laz 1.4)
Post by: LacaK on May 01, 2015, 09:42:59 pm
Solution is "relative" simple. Just take version of dblookup.inc prior to rev.45578
For example: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/include/dblookup.inc?view=co&revision=45392&root=lazarus

And you must recompile using it. Of course it is not trivial if you are not familiar with it.
Title: Re: tDBF filters not working (Laz 1.4)
Post by: bill0287 on May 01, 2015, 11:21:15 pm
I assume you mean to take the file you have linked, replace the same file on my local system, and then recompile my app again?  Correct?

But what really concerns me most however is getting the broken version fixed and then rolled back into a Laz that is publicly available (and not 6 months from now)? This error effectively breaks any apps using this component, which to me is a pretty serious bug.
Title: Re: tDBF filters not working (Laz 1.4)
Post by: LacaK on May 03, 2015, 07:27:49 pm
Hard to say when this bug will be fixed and when goes into distribution.
If it will be fixed fast, then it can go into Lazarus 1.4.2
Question is when 1.4.2 will be released? I do not know, but I expect at least 2 months.

If this behavior is for you critical, use older Lazarus and wait  :)
Title: Re: tDBF filters not working (Laz 1.4)
Post by: sin_dragan on May 03, 2015, 09:27:21 pm
I ve tried this workaround and confirm that it works ok.
TinyPortal © 2005-2018