MS ACCESS ADO SQL QUERY - SYNTAX ERROR IN UPDATE STATEMENT


experts,

what am i doing wrong???

getting syntax error in update statement....


procedure TForm1.Button1Click(Sender: TObject);

var

crud:string;
result:string;

begin

crud:='1';
result:='300';

ADO.Close;
ADO.SQL.Clear;
ADO.SQL.Add('UPDATE clients SET ');
ADO.SQL.Add('total left = :P_STS' );
ADO.SQL.Add('WHERE clientid = ' + QuotedStr(crud));
ADO.Parameters.ParamByName('P_STS').value := result;
  ADO.ExecSQL;
LVL 2
Oli999Asked:
Who is Participating?
 
geobulConnect With a Mentor Commented:
Hi,

Change the following line only:

ADO.SQL.Add('[total left] = :P_STS' );

Regards, Geo
0
 
mokuleConnect With a Mentor Commented:
What is total left?
ADO.SQL.Add('total left = :P_STS' );
Is it one field or two.
if it is one it should be enclosed in brackets or quotes.
I'm not sure if the space at the end of this string is not necessary

mokule
0
 
Oli999Author Commented:
total left is a field
0
All Courses

From novice to tech pro — start learning today.