[SOLVED] How to use ZUpdateSQL lazarus / 16-Databases ---------------------------------------------------------------------- pcurtis · 2021-03-13 06:47 I have a query that I can't update because of the JOIN sSQL := ' SELECT DISTINCT' +           ' tnURL.fnTOPIC_IDX,' +           ' tnTOPIC.fnIDX,' +           ' tnTOPIC.fnCHECK,' +           ' tnTOPIC.fnCAMELCASE,' +           ' tnTOPIC.fnNEWPOST,' +           ' tnTOPIC.fnLASTPOST,' +           ' tnTOPIC.fnTOPIC,' +           ' tnTOPIC.fnNEWIMAGES,' +           ' Max(tnURL.fnPOSTCOUNT) As fnPOSTCOUNT_MAX' +           ' FROM tnURL' +           ' INNER JOIN tnTOPIC ON tnTOPIC.fnIDX = tnURL.fnTOPIC_IDX' +           ' WHERE' +           ' fnFAVORITE = 1' +           ' Group By' +           ' tnURL.fnTOPIC_IDX,' +           ' tnTOPIC.fnCAMELCASE,' +           ' tnTOPIC.fnTOPIC' +           ' Order By' +           ' fnNEWIMAGES DESC,' +           ' tnTOPIC.fnCAMELCASE';  The query is displayed in a dbgrid. There is a column of checkboxes based on fnCHECK. All is displayed OK, but when I try to update using zquery.edit .... zquery.post I get the warning that I can't update a complex query. I understand I need to use ZUpdateSQL The problem is I haven't got a clue how to use it, and I can''t find any helpful docs. Can any one help please. Thanks in advance. ---------------------------------------------------------------------- paweld · 2021-03-13 09:15 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 ZQuery1.UpdateObject := ZUpdateSQL1;  ZUpdateSQL1.ModifySQL.Text := ' update tnTOPIC set fnCHECK=:fnCHECK, fnCAMELCASE=:fnCAMELCASE where fnIDX=:fnIDX '; ---------------------------------------------------------------------- pcurtis · 2021-03-13 11:50 Does nothing. See attached, simplified, project (includes db data) ---------------------------------------------------------------------- paweld · 2021-03-13 16:14 changed mysql to sqlite, get: https://www.sqlite.org/2021/sqlite-dll- win32-x86-3350000.zip , unzip and copy a dll and def files to folder with application ---------------------------------------------------------------------- pcurtis · 2021-03-14 02:25 Thanks My version attached.