[Solved] - Parameter 'user' not found. lazarus / 16-Databases ---------------------------------------------------------------------- kholyphoenix1 · 2019-09-09 20:53 Hello, i need help with this SQL. An error is occurring that says: Parameter "user" not found. 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 procedure TForm1.btnExecutar2Click(Sender: TObject);begin  SQLQuery2.Close;  SQLQuery2.SQL.Clear;  SQLQuery2.UpdateSQL.Add('UPDATE access_register SET password= :password WHERE user = :user');  SQLQuery2.Params.ParamByName('user').AsString := 'jr';  SQLQuery2.Params.ParamByName('password').AsString:= '12345';  try    //SQLQuery2.Active:=True;    //SQLQuery2.Open;    //SQLQuery2.Prepare;    SQLQuery2.ExecSQL;    SQLTransaction2.Commit;  except    on E: Exception do      begin        ShowMessage('Error: ' + E.Message );      end;  end;end; ---------------------------------------------------------------------- GAN · 2019-09-09 22:02 You must set the params before UpdateSQL.Add Ignore me, sorry, I had a bad day... ---------------------------------------------------------------------- valdir.marcos · 2019-09-10 02:58 Quote from: kholyphoenix1 on September 09, 2019, 10:53:40 pmHello, i need help with this SQL. An error is occurring that says: Parameter "user" not found. 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 procedure TForm1.btnExecutar2Click(Sender: TObject);begin  SQLQuery2.Close;  SQLQuery2.SQL.Clear;  SQLQuery2.UpdateSQL.Add('UPDATE access _register SET password= :password WHERE user = :user');  SQLQuery2.Params.ParamByName('user').AsString := 'jr';  SQLQuery2.Params.ParamByName('password').AsString:= '12345';  try    //SQLQuery2.Active:=True;    //SQLQuery2.Open;    //SQLQuery2.Prepare;    SQLQuery2.ExecSQL;    SQLTransaction2.Commit;  except    on E: Exception do      begin        ShowMessage('Error: ' + E.Message );      end;  end;end;Shouldn't "access _register" be only one word instead of two? Try this one: 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 procedure TForm1.btnExecutar2Click(Sender: TObject);begin  SQLQuery2.Close;  SQLQuery2.SQL.Clear;  SQLQuery2.SQL.Add('UPDATE access_register SET password= :password WHERE user = :user');  SQLQuery2.Params.ParamByName('user').AsString := 'jr';  SQLQuery2.Params.ParamByName('password').AsString:= '12345';  try    SQLQuery2.ExecSQL;    SQLTransaction2.Commit;  except    on E: Exception do      begin        ShowMessage('Error: ' + E.Message );    end;  end;end; ---------------------------------------------------------------------- valdir.marcos · 2019-09-10 03:01 Quote from: GAN on September 10, 2019, 12:02:53 amYou must set the params before UpdateSQL.AddThis doesn't seem to be relevant. QuoteCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i begin  SQLQuery2.Close;  SQLQuery2.SQL.Clear;  SQLQuery2.Params.ParamByName('user').AsString := 'jr';  SQLQuery2.Params.ParamByName('password').AsString:= '12345';    SQLQuery2.UpdateSQL.Add('UPDATE access _register SET password= :password WHERE user = :user');  tryBut, an UPDATE command without a SELECT command might become an issue. ---------------------------------------------------------------------- Zvoni · 2019-09-10 09:19 He clears the SQL-Prop of his Query2, but then Adds to the UpdateSQL- Property...... Why not just Query2.SQL.Clear; Query2.SQL.Text:='UPDATE blablablablabnl....'; Query2.Params...blablabla; Query2.ExecSQL; ---------------------------------------------------------------------- kholyphoenix1 · 2019-09-10 10:27 Quote from: Zvoni on September 10, 2019, 11:19:30 amHe clears the SQL- Prop of his Query2, but then Adds to the UpdateSQL-Property...... Why not just Query2.SQL.Clear; Query2.SQL.Text:='UPDATE blablablablabnl....'; Query2.Params...blablabla; Query2.ExecSQL; Solved, i changed for 'sql.text' Thanks all!!!