SQLdb and RefreshSQL lazarus / 16-Databases ---------------------------------------------------------------------- KarenT · 2017-05-22 17:34 I am not familiar with having more than one SQL.Text functions built in the same Query. I can't find any Help on why this (and other ...SQL) are included. Seems like it might be a good thing depending on how they work, but the Help is more a reference rather than actual "help." How is RefreshSQL (InsertSQL, UdateSQL etc) used? I understand *how* they are used as an SQL text, but confused as to when/why it is used. If I assigned this to it at Design time,. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   aSQL.RefreshSQL.Text:='SELECT * FROM table';  Then at some time later I use the normal SQL Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   aSQL.SQL.Text:='SELECT * FROM table ORDER BY name';  aSQL.ExecSQL;  If some time after that I use Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   aSQL.Refresh;  Will it revert to the "un-ordered" use of the RefreshSQL.Text by using that? Or what? ---------------------------------------------------------------------- mangakissa · 2017-05-23 06:37 If you want a result back, never use execSQL. This function is for insert/update/delete. If you're using SQLdb, a required dataset will bet put in TBufdataset. This is a memtable. You're 'disconnected' from the original table. By sorting directly you can use 'ORDER BY'. But there's also a property indexfieldnames which sort your dataset. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   indexfieldnames := 'name';  When using this property a refresh of your query will sort the dataset again with your given name.