Near 'set':Syntax Error - not that I can see! lazarus / 16-Databases ---------------------------------------------------------------------- HatForCat · 2017-04-14 22:38 This is driving me crazy, a short trip I know, but... The Table name is correct, it is not locked by anything else. Where is the syntax error? Where am I going wrong? 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   tStr:='UPDATE People SET zActive = 0, zEmailAddr = "help@amazon.com"  WHERE zID = 6;' ;  sqlPeople.SQL.Text:=tStr;  sqlPeople.ExecSQL;  Thanks ---------------------------------------------------------------------- talorigomat · 2017-04-15 02:16 To assign a value to a variable use ":=" line 1 should read: tStr := 'UPDATE People SET zActive = 0, zEmailAddr = "help@amazon.com"  WHERE zID = 6;' ; Also notice the semicolon that is outside the final single quote.  Without this the program would fail to compile. I am assuming the database you are using accepts a pair of double quotes to delimit strings as the one I work with uses single quotes. ---------------------------------------------------------------------- HatForCat · 2017-04-15 12:04 Quote from: talorigomat on April 15, 2017, 04:16:58 amTo assign a value to a variable use ":=" Thanks, my mistake. I copied that from the Debugging Window. I used that so it was displaying exactly what the running program was seeing. In the program it is constructed correctly and compiles and runs. Just keeps declaring an error on a line that looks OK to me. I will correct the OP Code. The pertinent Code/SQL etc details are in my Signature. ---------------------------------------------------------------------- valdir.marcos · 2017-04-17 13:36 Quote from: HatForCat on April 15, 2017, 12:38:29 amCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   tStr:='UPDATE People SET zActive = 0, zEmailAddr = "help@amazon.com"  WHERE zID = 6;' ;  sqlPeople.SQL.Text:=tStr;  sqlPeople.ExecSQL;  Try chance double quote to single quote on string inside SQL.Text: 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   tStr:='UPDATE People SET zActive = 0, zEmailAddr = ''help@amazon.com'' WHERE zID = 6;' ; or 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   tStr:='UPDATE People SET zActive = 0, zEmailAddr = ' + QuotedStr('help@amazon.com') + ' WHERE zID = 6;' ; ---------------------------------------------------------------------- mangakissa · 2017-04-18 07:36 create less errors to use parameters 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 with sqlPeople dobegin  SQL.text  := 'UPDATE People SET zActive = :zActive, zEmailAddr = :zEmailAddr  WHERE zID = :zID;' ;  parambyname('zActive').AsInteger := 0;  parambyname('zEmailAddr').AsString := 'help@amazon.com';  parambyname('zID').AsInteger := 6;  sqlPeople.ExecSQL;