Subject Mounting fields inside TIBOQuery
Author Mauro Rocha
Hello.

In version 4.8, I would use the following code to set a query and mount its fields for use inside a Dataset grid (not using IBObjects grid):

  Query1.SQL.Text := 'select ... from ... where ...';
  Query1.Fields.Clear;

  // add existing fields
  Query1.FieldDefs.Update;
  for i := 0 to Query1.FieldDefs.Count - 1 do
    Query1.FieldDefs[i].CreateField( Query1 );

  // add calculated field
  ...

Now when I run this code, the "for" loop raises an error for duplicated field. Has this behaviour changed? How can I fix it?

Best regards.

Mauro.