I'm trying to filter a TDBGrid
via a TEdit
, handling the TEdit
onChange
event.
I have a TIBQuery
to list all the records in the grid:
SELECT id,obra,cliente,fecha,nro_estudio,sondeo FROM proyecto;
When the user inserts characters in the TEdit
, the grid must be refreshed by the Cliente
field.
My code tries to do this, but when it executes the handler, the query returns an empty resultset. I'm using Firebird 2.5 and IB Components.
Relevant Code:
query := Self.qryTodos;
query.Close();
query.SQL.Clear();
query.SQL.Add('SELECT id,obra,cliente,fecha,nro_estudio,sondeo FROM proyecto WHERE cliente LIKE :Cliente');
query.ParamByName('Cliente').AsString := QuotedStr('%'+Self.busqueda.Text+'%');
query.Open();
DMConnect.Transaction.Commit();