Posted by John, DelphiLand Team on January 30, 2008
In Reply to Turbo Delphi and database filter posted by Bjorn2 p15905 on
January 29, 2008
: For database programs, I use an old professional Delphi edition together with dBase tables. Disadvantage: I have to install the BDE on computer of the user.
: Recently, in DelphiLand Forum I read that we can program database applications with Turbo Delphi Explorer, that don't need the BDE. Seems that for small tables without the "overkill" BDE, Turbo Delphi Explorer seems better, using TClientDataSet component and XML files.
: But can a ClientDataSet also have a Filter, just like the BDE TTable component? Otherwise I shall not upgrade, because my old applications would not work (recompile) anymore.
In Turbo Delphi (and Delphi 2006/ 2007/ 2008...), the Filter property of a ClientDataSet works just like this property for a TTable component. For example, a filter that gives only the records where the field Last_Name starts with an 'S':
1. Set ClientDataSet.FilterOptions to [foCaseInsensitive]
2. Set ClientDataSet.Filter to the string that defines the filter:
Last_Name = 'S*'
3. Set ClientDataSet.Filtered to True.
Note: Turbo Delphi as well as the free Turbo Delphi Explorer happily can co-exist with your older Delphi version, afterwards you still can use your Delphi 4.
On one of my computers I have Turbo Delphi for Win32, Delph 7 Personal, Delphi 4 Professional and the pre-historic ;) Delphi 1!