 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Wolfgang Zehntner Guest
|
Posted: Thu Feb 12, 2004 10:20 am Post subject: Filterproblem with TDBMemo |
|
|
Hello,
I got a paradox table and I am trying to set
some filter conditions.
the table has 11 fields of type TDBEdit
and 1 field of type TDBMemo
When I set a filter condition for a TDBEdit-field,
everthing works as expected:
with DataModule1.DataSource1.Dataset do
begin
Filter := 'Field1 = 'A*''; // list only records starting with 'A'
Filtered := True;
end
When I try to set a filter condition for the TDBMemo,
I get an error message. the Message is in german:
"Fehlende Typübereinstimmung im Ausdruck"
and I am not sure how to translate it to english,
something like "Missing typeconformity in expression"
with DataModule1.DataSource1.Dataset do
begin
Filter := 'Field12 = 'A*'';
// ^^^ here I get the error message, when field12 is of type TDBMemo
Filtered := True;
end
Can anybody help me on this or does filtering
not work for TDBMemos ?
regards
Wolfgang
|
|
| Back to top |
|
 |
Dell Stinnett Guest
|
Posted: Thu Feb 12, 2004 2:17 pm Post subject: Re: Filterproblem with TDBMemo |
|
|
I think you may have to use the "OnFilterRecord" event handler for memos
instead of the Filter Property. Something like this:
procedure TForm1.Table1FilterRecord(DataSet: TDataSet; var Accept: Boolean);
begin
if Dataset.Filter = '' then //the Filter is blank
Accept := copy(DataSet.FieldByName('Field12').AsString, 1, 1) = 'A';
end;
-Dell
|
|
| Back to top |
|
 |
Wolfgang Zehntner Guest
|
Posted: Fri Feb 13, 2004 7:43 am Post subject: Re: Filterproblem with TDBMemo |
|
|
Dell Stinnett schrieb:
| Quote: | I think you may have to use the "OnFilterRecord" event handler for memos
instead of the Filter Property. Something like this:
procedure TForm1.Table1FilterRecord(DataSet: TDataSet; var Accept: Boolean);
begin
if Dataset.Filter = '' then //the Filter is blank
Accept := copy(DataSet.FieldByName('Field12').AsString, 1, 1) = 'A';
end;
-Dell
|
thanks for responding.
sigh ... this will be very cumbersome, because in my program,
the user can already set any filter conditions with any fields.
I provide a Tmemo, where the user manually types expressions for
the filter conditions, e.g.
(field1 = 'A*') AND (field2 > '1')
As soon as the user would define something with Field12 (=TDBMemo),
I would be in trouble; I would have to scan the expressions, and that
would be very hard ...
Any other hints ?
Wolfgang
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|