[SOLVED] SQLite3 Zeos Search lazarus / 16-Databases ---------------------------------------------------------------------- Pe3s · 2021-11-16 20:31 Hello, I have such a problem with the search. The plan is that after typing in edit, the database is to display the matching names and after deleting it, display everything. 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.Close;  ZQuery1.SQL.Clear;  ZQuery1.SQL.Add('select * from testtbl WHERE Imie='+QuotedStr(Edit5.Text));  ZQuery1.ExecSQL;   I can ask for help Thank you for all your help. Regards ---------------------------------------------------------------------- korba812 · 2021-11-16 21:28 Try 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.Open;instead 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.ExecSQL; ---------------------------------------------------------------------- dseligo · 2021-11-16 23:34 As korba812 said, but also: 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.Close;  ZQuery1.SQL.Clear;  ZQuery1.SQL.Add('select * from testtbl';  If Edit5.Text <> '' then    ZQuery1.SQL.Add('WHERE Imie='+QuotedStr(Edit5.Text));  ZQuery1.Open; ---------------------------------------------------------------------- Pe3s · 2021-11-17 06:11 Unfortunately it does not work ---------------------------------------------------------------------- Zvoni · 2021-11-17 07:32 Use parameters. another thing might be that you're comparing equality, meaning it has to be an exact match incl. Case Maybe use "LIKE" instead of "=" Don't forget the wildcards ---------------------------------------------------------------------- balazsszekely · 2021-11-17 07:45 @Pe3s QuoteUnfortunately it does not workWhat exactly does not work? Please be more specific. PS: See attached project. On Windows you need sqlite3.dll. On Linux please change cnMain.LibraryLocation(form create). ---------------------------------------------------------------------- Pe3s · 2021-11-17 09:20 does not search data ---------------------------------------------------------------------- wp · 2021-11-17 09:43 For me dseligo's code is working - see attachment. ---------------------------------------------------------------------- balazsszekely · 2021-11-17 10:53 @wp QuoteFor me dseligo's code is working - see attachment.Yes it works, but if I understood the OP correctly, he wants to change the list on each keypress. Similar to the Object Inspector's Properties filter. Also closing then (re)opening the query on each search might not be optimal on large tables. This is why I choose the Filtered/OnFilterRecord property and event. ---------------------------------------------------------------------- Zvoni · 2021-11-17 11:13 Quote from: GetMem on November 17, 2021, 11:53:40 am@wp QuoteFor me dseligo's code is working - see attachment.Yes it works, but if I understood the OP correctly, he wants to change the list on each keypress. Similar to the Object Inspector's Properties filter. Also closing then (re)opening the query on each search might not be optimal on large tables. This is why I choose the Filtered/OnFilterRecord property and event. Look at my post #4 He checks equality