Changing FieldDefs manualy is IMO not good idea. FieldDefs reflects structure of underlaying database data, so every time you change SQL and reopens dataset FieldDefs are updated as needed.
Another situation is with Fields. May be that you have defined persistent Fields ? or there is some DB control with expects FieldName='ColumnX' ?
Yes, I let the Query set the Fields, as usual, in the app.
Due to the problem, though, I thought maybe I would try to set Fields to none, or zero fields, before sending the Query. I found that Clear applies. So I suppose that is the answer to my question, but the problem is still there.
Another situation is with Fields. May be that you have defined persistent Fields ?No, to this.
or there is some DB control with expects FieldName='ColumnX' ?
I will check for this. I don't think so, though.
I have been troubleshooting this app all day, though, and found that an old app, in which I base this new app INDEED WORKS correctly. So it must be features that the new app has (and all of them work), but somehow something affects that function resulting in the problem explained.
So what I will do is check for what you suggest, but will redo a new project with the old project where the problem is not there, and I will add the new features one by one and test to see if/where/when then problem mentioned is created.
Hence, I think I'll have to settle this here as said. I don't think is a Lazarus problem.
I will report what I find.
Thanks again, and also, thanks Knipfty for trying to help.