Yo lo realizo de esta manera espero sea de tu ayuda
Código Delphi
[-]
dm.ADOQuery_libros_filtro.Close;
dm.ADOQuery_libros_filtro.SQL.Clear;
dm.ADOQuery_libros_filtro.SQL.Add('Select* from libros where couter like :cod');
dm.ADOQuery_libros_filtro.Parameters.ParamByName('cod').Value:= '%'+txtdato.Text+'%';
dm.ADOQuery_libros_filtro.Open;
if (dm.ADOQuery_libros_filtro.IsEmpty) then
begin
ShowMessage('El Dato ('+txtdato.Text+') No Esta Registrado ');
end
else
begin
DBGrid1.Visible:= true;
DBGrid1.DataSource:= dm.DsFiltro;