Lazarus
Programming => Databases => Topic started 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?
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.
-
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 ?
-
Filed a bug:
http://bugs.freepascal.org/view.php?id=27959
-
Filed a bug:
http://bugs.freepascal.org/view.php?id=27959
You are using DBLookupComboBox badly.
Add a second ComboBox.
Michal
-
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)?
-
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 ...
-
Is there any hope of this getting fixed/released any time soon?
-
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.
-
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.
-
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 :)
-
I ve tried this workaround and confirm that it works ok.