ZTable SQL Query
Posted: 21.07.2009, 15:05
Hello everyone,
I'm currently making an application with Delphi 7 and i used ZeosLib (6.6.5-Stable) to connect to a MySQL 5 server. It works very great except for the filter. I've read the documentation and seen examples but somehow mine isn't working.
I use a TZConnection componet to connect to the MySQL 5 database server, A TZTable component for every table (there are 7 tables) and 7 TDataSource for every TZTable. Then there's a TDBGrid wich shows all the data of a certain TDataSource.
Basicly it's like this:
TZConnection --> TZTable --> TDataSource --> TDBGrid
Whenever i try to apply filter on the TZTable component e.g.:
ZTable1.Filter :='`PatientID` like ' + QuotedStr(Edit1.Text + '*');
ZTable1.Filtered := True;
The TDBGrid always becomes empty. Even when i try to apply a filter like '`PatientID` > 1'; It just doesnt show anything.
Does anyone have a clue what im doing wrong with the filter?
If the filter isn't suited for what i want is it possible to execute a SQL Query from the TZTable component so the TDBGrid will update to it?
I'm currently making an application with Delphi 7 and i used ZeosLib (6.6.5-Stable) to connect to a MySQL 5 server. It works very great except for the filter. I've read the documentation and seen examples but somehow mine isn't working.
I use a TZConnection componet to connect to the MySQL 5 database server, A TZTable component for every table (there are 7 tables) and 7 TDataSource for every TZTable. Then there's a TDBGrid wich shows all the data of a certain TDataSource.
Basicly it's like this:
TZConnection --> TZTable --> TDataSource --> TDBGrid
Whenever i try to apply filter on the TZTable component e.g.:
ZTable1.Filter :='`PatientID` like ' + QuotedStr(Edit1.Text + '*');
ZTable1.Filtered := True;
The TDBGrid always becomes empty. Even when i try to apply a filter like '`PatientID` > 1'; It just doesnt show anything.
Does anyone have a clue what im doing wrong with the filter?
If the filter isn't suited for what i want is it possible to execute a SQL Query from the TZTable component so the TDBGrid will update to it?