Mhhh
Funktionieren tut es aber man muss es wohl noch verbessern
Delphi-Quellcode:
procedure TForm1.FilterNoCaseSensitive(Table : TFDTable );
var
_Connection : TFDConnection;
LocalSQL : TFDLocalSQL;
MemTable : TFDMemTable;
Filter : string;
S : string;
Stream : TStream;
arr : t64Array;
i : Integer;
begin
Stream := TStream.Create;
_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('Counter', ftLargeint);
MemTable.FieldDefs.Add('FELD1', ftString, 1000);
MemTable.CreateDataSet;
LocalSQL.Active := True;
MemTable.Active := True;
Table.First;
while not Table.Eof do begin
MemTable.Insert;
MemTable['COUNTER'] := Table['COUNTER'];
Stream := Table.CreateBlobStream(Table.FieldByName('FELD1') , bmRead);
S := RTF_Stream_To_Plain_Text(Stream);
S := LowerCase(S);
MemTable['FELD1'] := S;
MemTable.Post;
Table.Next;
end;
MemTable.Filter := 'FELD1 LIKE ''%'+'test'+'%''';
MemTable.Filtered := False;
MemTable.Filtered := True;
arr := DumpTable(MemTable, ListBox2.Items);
S := '';
for i := Low(arr) to High(arr) do
S := S + IntToStr(arr[i]) + ',';
Delete(S,Length(S), 1);
S := 'COUNTER in (' + S + ')';
FDTable1.Filter := S;
FDTable1.Filtered := True;
MemTable.Free;
LocalSQL.Free;
_Connection.Free;
Stream.Free;
end;
Nochmal Danke für die Hilfe