Maybe you should be more specific on how you opened the paradox database: ODBC? The paradox component which comes with Lazarus (components/paradox)? The TParadoxDataset from CCR (or OPM)?
I am using the latter one occasionally for viewing old paradox files and/or converting them to sqlite3 (
https://github.com/wp-xyz/ParadoxViewer). Trying now to filter records I am stuck with the same issue: Filtering works for string or integer fields (
ParadoxDataset.Filter := 'StringField="A*"';), but fails for date fields, just as you are reporting. I noticed that filtering goes through the TBufdataset expression engine and thus should comply to the same rules working for example TDbf, such as the expression
ParadoxDataset.Filter := 'DTOS(DateField)="20001231". Interestingly this one does not raise an expression, but leaves an empty row in my DBGrid, and finally the application crashes when the mouse is moved into the grid so that it must be redrawn (*). I speculate that TParadoxDataset has an issue here?
What certainly is working for sure is to provide a handler for the OnFilterRecord event:
procedure TForm1.ParadoxDataset1FilterRecord(DataSet: TDataSet;
var Accept: Boolean);
var
dt: TDate;
begin
dt := Dataset.FieldByName('DateField').AsDateTime;
Accept := (dt = EncodeDate(2000,12,31));
end;
(*)
I just have been able to fix this: The crash happened when a popup hint would appear over the empty grid row when the filter had returned only an empty dataset. In dbgrids.pas, the line "if (F <> nil)" must be extended to "if (F <> nil) and not F.IsNull" in function TCustomDBGrid.GetTruncCellHintText.