Folgender Code funktioniert so wie erwartet, case sensitive. Falls das beim OP nicht geht, liegt es evtl. an der Konfiguration des FireBird.
Delphi-Quellcode:
program FDCaseInsensitive;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
Data.DB,
FireDAC.Stan.Def,
// IFDStanConnectionDef
FireDAC.Phys.SQLite,
// TFDPhysSQLiteDriverLink
FireDAC.Comp.Client,
// TFDConnection
FireDAC.Phys.SQLiteVDataSet;
// TFDLocalSQL
const
Filters :
Array[0..1]
of string = ('
ABC', '
abc');
var
Connection : TFDConnection;
LocalSQL : TFDLocalSQL;
MemTable : TFDMemTable;
Filter :
string;
procedure DumpTable;
begin
Writeln('
Filter: '+MemTable.Filter);
MemTable.First;
while not MemTable.Eof
do
begin
Writeln(MemTable['
FELD1']);
MemTable.Next;
end;
end;
begin
try
Connection := TFDConnection.Create(
nil);
Connection.DriverName := '
SQLite';
LocalSQL := TFDLocalSQL.Create(
nil);
LocalSQL.Connection := Connection;
MemTable := TFDMemTable.Create(
nil);
MemTable.
Name := '
Testtable';
MemTable.LocalSQL := LocalSQL;
MemTable.FieldDefs.Add('
FELD1', ftString, 20);
MemTable.CreateDataSet;
LocalSQL.Active := True;
MemTable.Active := True;
for Filter
in Filters
do
begin
MemTable.InsertRecord(['
X'+Filter+'
X']);
end;
DumpTable;
for Filter
in Filters
do
begin
MemTable.Filter := '
FELD1 LIKE ''
%'+Filter+'
%''
';
MemTable.Filtered := True;
DumpTable;
end;
MemTable.Free;
LocalSQL.Free;
Connection.Free;
Readln;
except
on E:
Exception do
Writeln(E.ClassName, '
: ', E.
Message);
end;
end.