Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Delphi Filter Record (https://www.delphipraxis.net/176270-filter-record.html)

danten 23. Aug 2013 05:34

Datenbank: AbsoluteDatabse • Version: 1 • Zugriff über: 1

Filter Record
 
Hi all,
I need to filter a large database of the selected conditions.
ComboBox1 = choice of table columns (FiledByName)
ComboBox2 = selection operator (<> =)
Edit1 = search text

I get an error in this code:

Delphi-Quellcode:
DataSource1.DataSet.Filtered := False;
  DataSource1.DataSet.Filter := QuotedStr(ComboBox1.Text)+ QuotedStr(ComboBox2.Text) + ' '+
  QuotedStr(Edit1.text);
  DataSource1.DataSet.Filtered := True;
I thank you all for your help.

Perlsau 23. Aug 2013 06:24

AW: Filter Record
 
Nobody can help you if you don't describe the error you got. For example it could be a type mismatch error when you try to filter a integer column by a string argument. And you will get an error when you quote the selection operator. Your selection operator is already a string.

haentschman 23. Aug 2013 06:33

AW: Filter Record
 
Morning...
try this. :wink:
Delphi-Quellcode:
DataSource1.DataSet.Filtered := False;
DataSource1.DataSet.Filter := ComboBox1.Text + ComboBox2.Text + ' ' + QuotedStr(Edit1.text);
DataSource1.DataSet.Filtered := True;
...only the Search Value must be quoted.


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:05 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz