Discussion Locked

Find The word in page

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,
I write a Search Engine with Asp.
My database is created by Access .
When I show result in page I want find the word
in page.
I mean for example user type "Goal"
And results show in page ,
Find any goal in page and write it with another color (Like Yahoo and Google ,They Bold word)

Thanks

5 replies

by madestroitsolutions

This is very simple to achieve:
I can almost bet you are using an ADO recordset to retrieve the data. In any event, what you do is replace all occurrences of the word within the text with a color-formatted version. for Example, lets say user searches for "Goal"....
Once you retrieve the information from the database, you would do something like this

' Assuming you have a recordset named RS and
' your keyword is stored in variable KEY

FKEY = "" & KEY & ""
Data1 = RS.fields(1)
Data1 = replace(Data1, KEY, FKEY)
response.write Data1

Hope that helps, it you have any questions, write me an e-mail at webmaster@KingsDistributors.com

Good luck!

by madestroitsolutions

May I ask why have you rejected my answer? I just want to know out of curiosity, since I know that my answer works for a fact, because I use it myself, I am a webmaster. Thanks.

by eb_alavi

Hi,
Your answer Help me .
Thanks you. Please excuse me for reject your answer, I know it now.

Good Luck

This discussion is closed to new replies.