Print Page | Close Window

search formating

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=14734
Printed Date: 29 March 2026 at 1:24pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: search formating
Posted By: zMaestro
Subject: search formating
Date Posted: 17 April 2005 at 8:00pm
i made a simple search engine to search for text inside database field.
it works fine but my problem is when the text is formated in the field it doesn't bring it.
 
is there a way?



Replies:
Posted By: bootcom
Date Posted: 17 April 2005 at 9:24pm
Not too sure what you mean there zMaestro, but I interpret that as its not finding the full word as it's wrapped in tags Confused, correct me if Im wrong there lol.
 
Just create the SQL to do a LIKE (like this)
 

"SELECT * FROM aTable WHERE field LIKE '%" & request("search_text") & "%'"


Posted By: zMaestro
Date Posted: 18 April 2005 at 4:07am
if the field contents is: "My name is <b>zMaestro</b>"
the result which will appear is: My name is zMaestro
 
is i searched with the string "is zMaestro" there will be no result found.
if i worte in the string "is <b>zMaestro</b>" there will be results.
 
i got an idea from the code here, and i think that is the way, i take the message to a temp variable, and replace all the tag, and store the output, then search it, am i right?


Posted By: bootcom
Date Posted: 18 April 2005 at 4:15am
Post the code on here you are using matey, your being a little vague.
 
If your doing a standard search though, using the code I gave above should do the trick you could write "Mae" and it would find all records that have that in record entry of the field you are trying to search.
 
But let's take a look at the code you're trying ot use and I will hopefully be able to  help you out.


Posted By: zMaestro
Date Posted: 18 April 2005 at 8:48am

<table>
<%
set RSpecial= server.createobject ("ADODB.recordset")

QLSpecial = "SELECT * FROM aTable WHERE filedname LIKE '%"&Request("text")&"%' ORDER BY ID;"

RSpecial.open QLSpecial, Conn, 1, 3

While Not RSpecial.EOF

Response.Write "<tr><td>"&RSpecial("filedname")&"</td></tr>"

RSpecial.MoveNext : Wend

%></table>



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net