Solved

Compare string in a memo, for filtering

Posted on 2001-07-30
7
418 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
A short film showing how OnPage and Connectwise integration works.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now