I'm having a problem trying to run an update query in my database, delphi gives an error as an incorrect syntax, but I could not find the problem. Could someone help me please?
Follow prints:
Try:
'UPDATE Tbl_aluno SET nome = '+QuotedStr(edit_nome.text)+'
WHERE PRONTUARIO ='+QuotedStr(.....)
QuotedStr ensures that the parameter is enclosed in quotation marks, for example: name = 'AUGUSTO'
The error occurred because your query has no quotation marks in the text fields.
There are a few ways to put quotation marks around a delphi string:
QuotedStr ('string') function:
ShowMessage(QuotedStr('teste'));
Use three single quotes:
ShowMessage('''teste''');
Concatenate with ASII39 code
ShowMessage(#39+'teste'+#39);
or
ShowMessage(Chr(39)+'teste'+Chr(39));