[SOLVED] [BUG] Firebird - TSQQuery order lazarus / 16-Databases ---------------------------------------------------------------------- dlLAFAcxezKOjMZ4 · 2013-02-27 15:00 Lazarus 1.0.6 32 bits on Windows XP SP 3 - FPC 2.6.0 - Firebird 2.5.2 SuperServer. I have a TIBConnection, TSQL transaction and TSQLQuery connected together and a TDataSource and TDBGrid. I can open the query, add, modify and delete records, etc... In the query, I have an "order by" clause wichc corresponds to the primary key. When I open the query the records are sorted. My problem is when I add a record, the record is appended at the end of DBGrid and does not respect the order by clause. I tried IndexFieldsName, IndexDefs, etc... but no solution works except if I close the query and reopen it. Did I miss something ? ---------------------------------------------------------------------- exdatis · 2013-02-27 15:36 Save position(current id) and refresh dataset(of course disable controls, refresh, and again locate current id, enable controls). Regards. ---------------------------------------------------------------------- dlLAFAcxezKOjMZ4 · 2013-02-27 15:43 Thank you for your response. Is there no other solution ? ---------------------------------------------------------------------- BigChimp · 2013-02-27 16:00 Perhaps it has something to do with this bug: http://bugs.freepascal.org/view.php?id=23421 ... bug was in FPC and fixed in FPC trunk/2.7.1 (but not 2.6.0 or 2.6.2) ---------------------------------------------------------------------- dlLAFAcxezKOjMZ4 · 2013-02-27 17:17 In fact when I used IndexFieldNames I had repeatedly duplicated entries in the DBGrid. Thanks you very much ! I will stay tuned about this bug.