From: Paulo on
On the classic asp how can I return the words highlited on a search field
with the tag below:
<span style="background-color:#FFFF00">KeyWord returned</span>

So if I search a bookStore with the keyword, example: asp
"Select Title from books where title like '%asp%' "

if returns me:

"Learn asp in 10 days", will just highlited on screen: "Learn <asp> in 10
days"
"Creating components in asp", will just highlited on screen: "Creating
components in <asp>"

How to do it in classic asp?


From: Bob Barrows on
Paulo wrote:
> On the classic asp how can I return the words highlited on a search
> field with the tag below:
> <span style="background-color:#FFFF00">KeyWord returned</span>
>
> So if I search a bookStore with the keyword, example: asp
> "Select Title from books where title like '%asp%' "
>
> if returns me:
>
> "Learn asp in 10 days", will just highlited on screen: "Learn <asp>
> in 10 days"
> "Creating components in asp", will just highlited on screen: "Creating
> components in <asp>"
>
> How to do it in classic asp?

Use the Replace function:
hiliteprefix="<span style=""background-color:#FFFF00"">"
hitlitesuffix="</span>"
srchword="asp"
srchResult=<one of the results of the search>
srchResult=Replace(srchResult,srchword, _
hiliteprefix & srchword & hitlitesuffix)

Response.Write srchResult
--
HTH,
Bob Barrows