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?
#42000 Error Message
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.
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
I had similar problem having table InnoDB with only one Field of FLOAT type and with no constraints:
With some default values:
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:
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.
Code: Select all
CREATE TABLE `qn` (
`nazwa` float NOT NULL,
PRIMARY KEY (`nazwa`)
) ENGINE=InnoDB DEFAULT CHARSET=cp1250;Code: Select all
INSERT INTO qn VALUES (1), (1.5), (2);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
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.