FilterSQL in MyDAC 3.30 and 4.00.1.6

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
calix
Posts: 5
Joined: Fri 19 Nov 2004 04:54

FilterSQL in MyDAC 3.30 and 4.00.1.6

Post by calix » Fri 02 Dec 2005 14:01

Hello,

i´ve a problem with the TMyQuery.FilterSQL between MyDac 3.30 and 4.00.

Example:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  MyQuery1.Close;
  MyQuery1.SQL.Text:='select AZ1, AZ2, AZ3, Land from adress WHERE Land=''GB'' ORDER BY AZ1';
  MyQuery1.open;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  MyQuery1.FilterSQL:='AZ1 like ''%bank%''';
end;
Button1-Click an Button2-Click will work fine in 3.30
At Button2-Click in 4.00 comes an SQL-Error with the following SQL-Code

Code: Select all

select AZ1, AZ2, AZ3, Land 
from adress 
WHERE AZ1 like '%bank%'
WHERE Land='GB'
ORDER BY AZ1
It seems that in 4.00 the existing WHERE-Conditions will not recognized.

Did you have a solution for the problem?

Best regards
Harald

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 05 Dec 2005 10:01

Please check MydacVersion constant value in your program. It seems like you use MyDAC 4.00.1.5.

calix
Posts: 5
Joined: Fri 19 Nov 2004 04:54

Post by calix » Mon 05 Dec 2005 10:10

I´ve downloaded the latest version incl. sourcecode
MYDACVersion = '4.00.1.6';

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 05 Dec 2005 10:29

Please send us (mydac*crlab*com) a complete small sample to demonstrate it and include script to create and fill table.

Post Reply