It is not my intention being irritating, on the contrary. Composing this post I thought that subject was describing the problem, focusing on the SQL statement syntax and not to the code. I apologise. Your answer gives me the impression that you are tired reading this kind of not well described posts from me. I do not feel this is true, I only had another such comment once at the past in a case not more information was available than provided.
What I can promise is to try harder and read url with directions suggested. I also ask you to be patient in such cases, you see it is an international meeting point at which people with different cultures meet communicating in English, not mother language for many of us. So, please let me provide full code. While executing, code exit at .open point. Trying a test SELECT statement it is OK. If you can think anythink to direct me where to search it would be most helpful to me. // update ID data function mgspsUpdateIDData: integer; var nLicensesLeft: integer; cCustID: string; begin // update Result := MGSPS_ERROR_UPDATE_FAILED; nLicensesLeft := SQLQuery.FieldByName( 'ids-licenses-left' ).AsInteger - 1; cCustID := SQLQuery.FieldByName( 'ids-internet-id' ).AsString; SQLQuery.Close; SQLQuery.SQL.Clear; SQLQuery.SQL.Add( 'update `ids-aa`' ); SQLQuery.SQL.Add( ' set `ids-licenses-left`=1' ); SQLQuery.SQL.Add( ' where `ids-internet-id`="aa-123456789012345678"' ); SQLQuery.Open; Result := MGSPS_ALL_OK; end; > An why all these quotes arount the field names? Does that even compile? These quotes are necessary maybe because of field names form, dash character is used separating parts of names making these more readable. I tried it without quotes and had dificulties. This way works fine, I have Select statements executed normally but not this Update which I think is in a general accepted form. As I wrote on my complementary reply, this is running on Linux using SQLDB components and MySQL database server. Panagiotis Στις 15-03-2006, ημέρα Τετ, και ώρα 20:27 +0100, ο/η Joost van der Sluis έγραψε: > This is gettig irritating. > > 'statement is not accepted' > > Is that the error message? 'statement not accepted' You can't expect us > to keep answering this kind of questions. > > An why all these quotes arount the field names? Does that even compile? > > And read this, before you sent another question: > www.catb.org/~esr/faqs/smart-questions.html > > On Wed, 2006-03-15 at 21:14 +0000, Panagiotis Sidiropoulos wrote: > > I use following code to update a table. Connection is succesfuly carried > > out and before this, Select statement executed succesfuly. Problem is > > that this statement is not accepted. I checked this same statement > > through an MySQL client and it was executed properly. Can anyone please > > advise? > > > > SQLQuery.Close; > > SQLQuery.SQL.Clear; > > SQLQuery.SQL.Add( 'update `ids-aa`' ); > > SQLQuery.SQL.Add( 'set `ids-licenses-left`=1' ); > > SQLQuery.SQL.Add( 'where `ids-internet-id`="aa-123456789012345678"' ); > > showmessage( SQLQuery.SQL.Text ); > > SQLQuery.Open; > > > > I also tested this statement a one line setting this to .text property. > > > > Panagiotis > > > > _________________________________________________________________ > > To unsubscribe: mail [EMAIL PROTECTED] with > > "unsubscribe" as the Subject > > archives at http://www.lazarus.freepascal.org/mailarchives > > _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives