Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Compare string in a memo, for filtering

Posted on 2001-07-30
7
Medium Priority
?
471 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 3

Accepted Solution

by:
nnbbb09 earned 200 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

610 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