I need to know if it is possible to use a escape character for underscore to use it in ClientDataSet.Filter
Thanks
escape character for underscore (_)
Hello,
The TClientDataSet.Filter property doesn't use the '_' symbol for filtering data, it is recognized as a usual symbol. That's why you don't need to use any escape character for the '_' symbol if you want to use in TClientDataSet.Filter . For more information, please read the "Limiting what records appear" article of the Delphi documentation.
The TClientDataSet.Filter property doesn't use the '_' symbol for filtering data, it is recognized as a usual symbol. That's why you don't need to use any escape character for the '_' symbol if you want to use in TClientDataSet.Filter . For more information, please read the "Limiting what records appear" article of the Delphi documentation.
-
- Posts: 6
- Joined: Wed 08 Sep 2010 07:01
dataset filter error
Ok. Thanks a lot.
So i have still trouble with the dataset filter.
I have these datas in my dataset :
1_
1_try1
1_try2
when i try to do a filter with the sentence "1_t" I get also the sentence "1_" in my dataset.
Is it normal ?
Thanks for your answer
Best Regards
So i have still trouble with the dataset filter.
I have these datas in my dataset :
1_
1_try1
1_try2
when i try to do a filter with the sentence "1_t" I get also the sentence "1_" in my dataset.
Is it normal ?
Thanks for your answer
Best Regards
Please try using the following code:, and check if the filtering problem persists.
Code: Select all
ClientDataSet.Filter := 'fieldname=''1_t*''';
ClientDataSet.Filtered := True;
ClientDataSet.Open;
Last edited by AndreyZ on Wed 04 Apr 2012 12:35, edited 1 time in total.
-
- Posts: 6
- Joined: Wed 08 Sep 2010 07:01
escape character for underscore
I have tried your code but unfortunately i have still a filtering problem.
here is my code :
ClientDataSet.Filter := 'number=''1_t*''';
ClientDataSet.FilterOptions := [foCaseInsensitive];
ClientDataSet.Filtered := True;
thanks for your help
here is my code :
ClientDataSet.Filter := 'number=''1_t*''';
ClientDataSet.FilterOptions := [foCaseInsensitive];
ClientDataSet.Filtered := True;
thanks for your help