Solved

Compare string in a memo, for filtering

Posted on 2001-07-30
7
419 Views
Last Modified: 2010-04-06
I have a paradox table with a memo.  I need to find records containing a certain text in the memo.
I'm using a OnFilterRecord to do that.

Procedure TDataModule1.Table1FilterRecord(DataSet: TDataSet; var Accept: Boolean);
Begin
 Accept := Pos('Hello world', Table1.Memo.Text) ;
End ;

But it do not work.  I have an error message telling the memo can not be access in a filter.
How can I do that ???

Thank you.
0
Comment
Question by:syloux
7 Comments
 
LVL 3

Accepted Solution

by:
nnbbb09 earned 50 total points
ID: 6335499
Try this. It assumes that you have a field called memo in Table1.

Begin
  Accept := Pos('Hello world', Table1.FieldByName('Memo').AsString) > 0 ;
End ;
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6335559
Hello

Try sametext funcation

Procedure TDataModule1.Table1FilterRecord(DataSet: TDataSet; var Accept: Boolean);
Begin
Accept := SameText('HelloWorld',Table1['urField'])
End ;

Best regards
Mohammed Nasman
0
 

Author Comment

by:syloux
ID: 6335607
Always have this error message :

Cannot access field 'Memo' in a filter  :(((

0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 27

Expert Comment

by:kretzschmar
ID: 6335794
if  nnbbb09 comment not work, then it could be impossible,
except you don't have replaced 'Memo' with your real fieldname

but, maybe this helps, (just modified nnbbb09 comment, not tested)
Begin
  Accept := Pos('Hello world', TBlobField(Table1.FieldByName('Memo')).AsString) > 0 ;
End ;

meikl ;-)
0
 

Expert Comment

by:x4
ID: 6398527
I just tested  nnbbb09 comment and it works fine.
Created a form a table a source a grid and a button.
The grid displays the COMPONENTTYPE Field of the table.
When you turn on the filter only the Records in the
table that have 'COMPUTER' in them show.

*******************************************************
procedure TForm1.Table1FilterRecord(DataSet: TDataSet;
  var Accept: Boolean);
begin
  Accept := Pos('COMPUTER', Table1COMPONENTTYPE.Value) > 0;
end;
******************************************************
procedure TForm1.Button1Click(Sender: TObject);
begin
  Table1.Open;
  Table1.Filtered := True;
  Table1.Refresh;
end;
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8734986
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept nnbbb09's comment as answer

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question