[SOLVED] Is it possible to use parameters with ExecuteDirect? lazarus / 16-Databases ---------------------------------------------------------------------- guest48180 · 2018-05-31 04:15 I have a lot of text fields on a form. One of them is txt_Recipe_Name. I can't find documentation through the Forum Search or anywhere else on how to use parameters with ExecuteDirect. I can use them with SQLQuery but not with ExecuteDirect. Is it possible to use parameters with ExecuteDirect? Or is there another way to accomplish an Insert on a table and be able to write my form data to the table fields? This is what I have that I can't figure out how to make work: 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 SQLite3Connection1.ExecuteDirect('INSERT INTO recipe_names(name) VALUES(:r_name);');How can I set :r_name to a text field (TEdit field) on my form? For a SELECT statement, this works nicely: 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 SQLQuery2.SQL.Text:='SELECT * FROM recipe_ingredients WHERE name_id = :id';SQLQuery2.ParamByName('id').AsInteger:=SQLQuery1.FieldByName('nam e_id').AsInteger; I use Prepared statements in PHP for all my MariaDB queries. But I can't find information on how to use them on databases within Lazarus. A wiki maybe?  In any case, my main concern is being able to use data on my form to INSERT INTO an SQLite3 db. Anyone? ---------------------------------------------------------------------- guest48180 · 2018-05-31 05:56 Thank you, Juassic Park. All I've seen used on CREATE, INSERT, and UPDATE was ExecuteDirect. Your answer showed me different. Thanks. ---------------------------------------------------------------------- mangakissa · 2018-05-31 07:13 which answer? ---------------------------------------------------------------------- guest48180 · 2018-05-31 07:49 In the link @answer here and in my above post. ---------------------------------------------------------------------- fpcoder · 2018-05-31 09:59 SqlDB's ExecuteDirect doesn't work with parameters. https://www.freepascal.org/docs- html/fcl/sqldb/tsqlconnection.executedirect.html ---------------------------------------------------------------------- guest48180 · 2018-05-31 10:15 QuoteExecuteDirect does not offer support for parameters, so only statements that do not need parsing and parameters substitution can be handled. If parameter substitution is required, use a TSQLQuery component and its ExecSQL method. Thanks, kapibara.