?
Solved

MS ACCESS ADO SQL QUERY - SYNTAX ERROR IN UPDATE STATEMENT

Posted on 2005-03-21
3
Medium Priority
?
338 Views
Last Modified: 2010-04-16

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;
0
Comment
Question by:Oli999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 17

Assisted Solution

by:mokule
mokule earned 260 total points
ID: 13590423
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
 
LVL 2

Author Comment

by:Oli999
ID: 13590440
total left is a field
0
 
LVL 17

Accepted Solution

by:
geobul earned 240 total points
ID: 13590449
Hi,

Change the following line only:

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

Regards, Geo
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question