Page 1 of 1

#42000 Error message!!

Posted: Fri 15 May 2020 01:03
by MYDAC100
Hi,

When I run this code

Code: Select all

procedure TForm1.Button5Click(Sender: TObject);
begin
    Students_Table2.First;

    while Not   Students_Table2.Eof  do
    begin
          Students_Table2.Edit;

              Students_Table2.FieldByName('SENT').AsInteger := 1;
            Students_Table2.Post;

        Students_Table2.Next;
    end;
end;
end.

an error appears
"#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'KEY = 843' at line 5."

May you please help me to fix it so i can edit my Database

Re: #42000 Error message!!

Posted: Fri 15 May 2020 09:06
by ViktorV
Unfortunately, we haven't been able to reproduce the issue.
In order for us to be able to give you a detailed answer, we need to have a sample demonstrating the specified behavior. Therefore, please compose a small sample demonstrating the described behavior and send it to us using the contact form https://devart.com/company/contactform.html including the scripts for creating database objects. Please also indicate the full and accurate versions of MySQL and MyDAC.

Re: #42000 Error message!!

Posted: Sat 16 May 2020 11:21
by MYDAC100
I sent you the full code. waiting for your detailed answer

Re: #42000 Error message!!

Posted: Sun 17 May 2020 03:42
by MYDAC100
Still waiting for your help ... yet, haven't received any respond .. I sent the email with the source code but no answer

Re: #42000 Error message!!

Posted: Mon 18 May 2020 08:07
by ViktorV
To solve the issue, please, set the TMyTable.Options.QuoteNames property to True.

Re: #42000 Error message!!

Posted: Wed 20 May 2020 23:27
by MYDAC100
It works :)

THANK YOU

Re: #42000 Error message!!

Posted: Thu 21 May 2020 14:39
by ViktorV
Thank you for the interest to our product.
It is good to see that the problem has been solved.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.