Page 1 of 1

Filter option of a ZTable

Posted: 13.03.2008, 20:29
by Dolphin777
Hi
I need some help with the Filter option of a ZTable. I use BCB6 and Zeos 6.6.1. In my database tables have numeric codes as fieldnames ("010", "011" etc.) Data type is "currency".
When I try to use a filter I get an empty dataset:

ZTable1->Filter="010 = '321' ";
ZTable1->Filtered=true;

What is wrong?

Posted: 13.03.2008, 21:27
by sandeep_c24
Remove quotes around 321 and try.

Regards

Sandeep

Posted: 13.03.2008, 22:54
by Dolphin777
sandeep_c24 wrote:Remove quotes around 321 and try.

Regards

Sandeep
I tried, does not work

Posted: 14.03.2008, 09:03
by mdaems
Hi,

I'm not sure what database you are using, but I think you have to quote the Table names in the right way for your database. eg for mysql you should use backticks like

Code: Select all

ZTable1->Filter="`010` = 321 ";
Otherwise the database server does a numeric compare betwen your table name and the value searched for.
More generally, this is one of the reasons why it's not really a good idea to use purely numeric field names.

Mark