Recent

Author Topic: tDBF filters not working (Laz 1.4)  (Read 4483 times)

bill0287

  • Full Member
  • ***
  • Posts: 146
tDBF filters not working (Laz 1.4)
« 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.
« Last Edit: April 24, 2015, 12:55:15 am by bill0287 »

LacaK

  • Hero Member
  • *****
  • Posts: 600
Re: tDBF filters not working (Laz 1.4)
« Reply #1 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 ?

bill0287

  • Full Member
  • ***
  • Posts: 146
Re: tDBF filters not working (Laz 1.4)
« Reply #2 on: April 24, 2015, 09:57:27 pm »

miab3

  • Full Member
  • ***
  • Posts: 104
Re: tDBF filters not working (Laz 1.4)
« Reply #3 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

bill0287

  • Full Member
  • ***
  • Posts: 146
Re: tDBF filters not working (Laz 1.4)
« Reply #4 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)?

LacaK

  • Hero Member
  • *****
  • Posts: 600
Re: tDBF filters not working (Laz 1.4)
« Reply #5 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 ...

bill0287

  • Full Member
  • ***
  • Posts: 146
Re: tDBF filters not working (Laz 1.4)
« Reply #6 on: April 30, 2015, 11:45:17 pm »
Is there any hope of this getting fixed/released any time soon?

LacaK

  • Hero Member
  • *****
  • Posts: 600
Re: tDBF filters not working (Laz 1.4)
« Reply #7 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.

bill0287

  • Full Member
  • ***
  • Posts: 146
Re: tDBF filters not working (Laz 1.4)
« Reply #8 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.

LacaK

  • Hero Member
  • *****
  • Posts: 600
Re: tDBF filters not working (Laz 1.4)
« Reply #9 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  :)

sin_dragan

  • Full Member
  • ***
  • Posts: 127
Re: tDBF filters not working (Laz 1.4)
« Reply #10 on: May 03, 2015, 09:27:21 pm »
I ve tried this workaround and confirm that it works ok.
Windows 7 64 bit
Lazarus 1.4.1 (w/fixes) FPC 2.6.4 win32

 

TinyPortal © 2005-2018