[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Search a certain word in a field...

Posted on 2002-05-19
9
Medium Priority
?
163 Views
Last Modified: 2010-04-04
Hi experts,

How to search a certain word in a field of a record?

Field | Title                     | Year |
Data  | Monkey in the blue bottle | 1997 |

I just entered 'blue' and it will come out the above data.
I'm using D3 and MSAccess database.

TQ

iqmedia
0
Comment
Question by:iqmedia
[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
9 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 600 total points
ID: 7019411
select * from atable where fieldname like "%TheWord%"
0
 

Author Comment

by:iqmedia
ID: 7019415
Hi kretzschmar,

You're fast...

Is that all???? shisssss.... OK I'll try it first.

TQ expert.

iqmedia
0
 

Author Comment

by:iqmedia
ID: 7019417
Hi kretzschmar,

You're fast...

Is that all???? shisssss.... OK I'll try it first.

TQ expert.

iqmedia
0
Industry Leaders: 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!

 
LVL 4

Expert Comment

by:nestorua
ID: 7019741
HI,
Another method (in this case you don't need to change your
SQL if you use someone):
in the OnFilterRecord event of your TDataset write the following:
Accept:=Pos('blue', Dataset.FieldByName('Title').AsString)>0.
Sincerely,
Nestorua.
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 7019882
Hello

  if you are using Access database, you have to use * instead of %
 your SQL statment will be as:

Select * from urTable where Title like '*blue*'

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7019928
% does also work with access databases
(via ado tested)

meikl ;-)
0
 

Author Comment

by:iqmedia
ID: 7020921
Hi experts...

i got stuck yesterday and with these all comment i'll try to do it again... TQ experts.

iqmedia
0
 

Author Comment

by:iqmedia
ID: 7026457
Hi experts,

I got this error by doing that:
General SQL Error [Microsoft][ODBC Microsoft Access 97 Driver] Expression cannot be used with the LIKE predicate.

but then I change Access 97 to Paradox 7 and do this, and it work:

var wordtofind : string;
begin
  Edit1.Text := wordtofind;
  with Query1 do
  begin
    Close;
    SQL.Clear;
    SQL.Add('SELECT * FROM tableBook');
    SQL.Add('WHERE Title LIKE "%' + wordtofind + '%"');
    Open;
  end;
end;

iqmedia
0
 

Author Comment

by:iqmedia
ID: 7026459
I think this would be enough.. TQ

iqmedia
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

649 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