Page 1 of 1

SQL Error #42000 on MyDAC 4 - OK on MyDAC 3.55

Posted: Tue 02 Aug 2005 07:35
by TomS
In version 4, I'm getting the following error when trying to set a filter programmatically (The filter works fine when set manually in Design mode):
#42000You have an error in your SQL syntax; check the manual that corresponds to you MySQL server version for the right syntax to use near 'WHERE varer.ID = 123' at line 1.
The filter-setting code is:

Code: Select all

DM.qryVarer.FilterSQL := 'varer.ID=123';
DM.qryVarer.Filtered := True;
DM.qryVarer.Active := True;
The SQL statement is:

Code: Select all

SELECT varer.*, artister.ARTIST, varegrupper.FARGE, varegrupper.MVARATE
FROM varer
LEFT OUTER JOIN artister ON (varer.ARTIST_ID=artister.ID)
LEFT OUTER JOIN varegrupper ON (varer.VAREGRUPPE_ID=varegrupper.ID)
ORDER BY artister.ARTIST, varer.TITTEL;
This works fine in 3.55. What am I missing here?

Bug in 4.0

Posted: Tue 02 Aug 2005 09:40
by Hans
I don't think you are missing anything.
It looks as if the sortclausule is put prior to the whereclausule, which leads to errors.

Posted: Tue 02 Aug 2005 10:44
by Ikar
Fixed. We will try to make this fix available at current week.

Posted: Tue 02 Aug 2005 11:33
by TomS
Thanks for your prompt reply. I'll stand by for the fix... :-)

Tom

Posted: Thu 04 Aug 2005 20:06
by el_ade
I have the same problem, I have purchaded the mydac 4.0 and on recompiling of my application occurs the same problem.

Isn“t still available the fix?

Posted: Fri 05 Aug 2005 08:26
by Ikar
New build was released and you can download it (4.00.0.2) now from Core Lab server.
Please see details http://crlab.com/forums/viewtopic.php?t=1724

Posted: Fri 05 Aug 2005 15:45
by TomS
Lookin' good, guys. Lookin' REAL good.

Thanks.
:D :D :D