Filter option of a ZTable

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Dolphin777
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 12.03.2008, 22:02
Contact:

Filter option of a ZTable

Post 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?
sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

Post by sandeep_c24 »

Remove quotes around 321 and try.

Regards

Sandeep
Dolphin777
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 12.03.2008, 22:02
Contact:

Post by Dolphin777 »

sandeep_c24 wrote:Remove quotes around 321 and try.

Regards

Sandeep
I tried, does not work
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
Post Reply