Page 1 of 1

#42000 Error Message

Posted: Sun 07 Oct 2007 02:46
by danzman
MyDACV4.4/MySQL5.2

In the following:
myTable.append;
myTableField1.AsString:=MyTable2Field1.AsString;
...
...
myTable.Post;

I go the error #42000 error.

Where am I going wrong. Will the update fix this?

Posted: Tue 09 Oct 2007 14:52
by Antaeus
Please send me a complete small sample at evgeniyD*crlab*com to demonstrate it, including script to create and fill table.

Also supply me the following information:
- exact version of MyDAC. You can see it in the About sheet of TMyConnection Editor;
- exact version of your IDE (including personality name for Delphi 2005, and BDS 2006);
- exact version of MySQL server and MySQL client. You can see it in the Info sheet of TMyConnection Editor.

Similar problem, other conditions

Posted: Wed 17 Oct 2007 18:37
by m227
I had similar problem having table InnoDB with only one Field of FLOAT type and with no constraints:

Code: Select all

CREATE TABLE `qn` (
  `nazwa` float NOT NULL,
  PRIMARY KEY  (`nazwa`)
) ENGINE=InnoDB DEFAULT CHARSET=cp1250;
With some default values:

Code: Select all

INSERT INTO qn VALUES (1), (1.5), (2);
Then when I tried to delete any of records from MySQL Query Browser it was no problem.
But when I tried to do it from Delphi by TMyTable and it's Data Editor I got ERROR #42000 "....". The same when I was running the program, deleting records using DBNavigator was giving the same error. Adding or editing records was no problem.

So I bypassed the problem adding an extra ID field (INTEGER) not null, auto increment.
Hope this will help our DAC programmers.

I suspect that (re-)indexing with float field can lead to that problem.
Windows XP SP2, Turbo Delphi, MySQL 5.0.45, MyDAC 5.10.0.10.

Michal

Well :) as a matter of fact I found that my fix allowed me to delete records form under TMyTable -> Data Editor (design-time), but the problem still existed in runtime!
The whole Message was:

Code: Select all

#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 '' at line 2.
After investigating I found that i had to add the new ID field to TMyTable fields editor (silly mistake), where the previous one only was.