Jump to content
Sign in to follow this  
limelect

FDTable filter problem

Recommended Posts

I have done filtering in other databases with no problem.

This time I am using FDTable, My tries

ProjectsFDTable.Filtered:=false;

ProjectsFDTable.Filter:='Category =' +QuotedStr('Tools');

OR

ProjectsFDTable.Filter:='Category = Tools';

ProjectsFDTable.Filtered:=True;

Category is the column Tools is the data

The errors are mainly - Tools cannot be found as the Column <<<< how come?

With the QUERY component I have no problem but for my reasons

I want to do it with FDTable.

Any idea

PS. I tried with ProjectsFDTable.SQL nothing worked.

Share this post


Link to post

Which Delphi version. I've never used TFDTable but tested successfully in D11 the code:

 

ProjectsFDTable.Filter:='Category =' +QuotedStr('Tools');
ProjectsFDTable.Filtered:=true;


It's working.

Share this post


Link to post

@Lajos Juhász D10.2.3 Read and see I did try it !!!

 

My tries

ProjectsFDTable.Filtered:=false;

ProjectsFDTable.Filter:='Category =' +QuotedStr('Tools');

OR

ProjectsFDTable.Filter:='Category = Tools';

ProjectsFDTable.Filtered:=True;

Share this post


Link to post
5 minutes ago, limelect said:

D10.2.3 Read and see I did try it !!!

I read that, unfortunately I have no access to your working environment I can only confirm what's working at my side.

 

I do not have D10.2.3 to test, tried with XE5 it's also working without a problem there.

Share this post


Link to post

Thank The project is on 10.

P.S using your suggestion I get

Error 104 mismatch exspresion

Edited by limelect

Share this post


Link to post
10 minutes ago, limelect said:

Error 104 mismatch exspresion

If you've the source of FireDAC you can debug FireDAC.Stan.Expr there are 4 cases when this exception is raised.

Share this post


Link to post

Sure I am legitimate. Nice idea

OOOpes i do not have FireDAC.Comp.DataSet.pas

Edited by limelect

Share this post


Link to post

Professional Delphi does not have FireDAC resources !!!

Share this post


Link to post

FINALY I got it

 

 ProjectsFDTable.Filter := 'Category  LIKE ' +QuotedStr('Tools');

Thanks everybody

 

Share this post


Link to post
Guest

Just curious (do not use FireDac), if you have a Query component, why do you need to use a "table" component?

Share this post


Link to post

Read my comments above. It answers your question.

It is in my question

 

With the QUERY component I have no problem but for my reasons

I want to do it with FDTable.

 

Edited by limelect

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×