473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

searching through results


I know how to use the LIKE command in a query but how do I do it in the
results of a recordset?

results="<b>Hello</b> World"

I want to search the above result and if it has a <B> in it, I want set
hasabold="Y"
I need to be able to search through a large amount of text so the BOLD marks
will not always be at the front of the results. They maybe be on line 50
character 59, etc....


Jul 19 '05 #1
4 1313
Why don't you do it from the query?

It helps if you tell us which database you're using (see
http://www.aspfaq.com/5009), but for SQL Server:

SELECT hasabold = CASE WHEN CHARINDEX('<b>', column)>0 THEN 'Y' ELSE 'N'
END,
<otherstuff> FROM table

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Joey Martin" <ma******@bellsouth.net> wrote in message
news:Mu*********************@bignews4.bellsouth.ne t...

I know how to use the LIKE command in a query but how do I do it in the
results of a recordset?

results="<b>Hello</b> World"

I want to search the above result and if it has a <B> in it, I want set
hasabold="Y"
I need to be able to search through a large amount of text so the BOLD marks will not always be at the front of the results. They maybe be on line 50
character 59, etc....

Jul 19 '05 #2
Let me be more clear so as not to be confusing.

I am actually importing a text file. I am reading the lines and they are
goin into "sections".
For example section A may read: This is a test and it has a bold <b>
right</b> here.

It typically includes 10-20 lines of text.
I just need to look through that Section A and if it has a bold, mark it as
such use sectionabold=Y

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:ui**************@TK2MSFTNGP11.phx.gbl...
Why don't you do it from the query?

It helps if you tell us which database you're using (see
http://www.aspfaq.com/5009), but for SQL Server:

SELECT hasabold = CASE WHEN CHARINDEX('<b>', column)>0 THEN 'Y' ELSE 'N'
END,
<otherstuff> FROM table

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Joey Martin" <ma******@bellsouth.net> wrote in message
news:Mu*********************@bignews4.bellsouth.ne t...

I know how to use the LIKE command in a query but how do I do it in the
results of a recordset?

results="<b>Hello</b> World"

I want to search the above result and if it has a <B> in it, I want set
hasabold="Y"
I need to be able to search through a large amount of text so the BOLD

marks
will not always be at the front of the results. They maybe be on line 50
character 59, etc....


Jul 19 '05 #3
So, look at the INSTR() function of VBScript...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Joey Martin" <ma******@bellsouth.net> wrote in message
news:9P********************@bignews6.bellsouth.net ...
Let me be more clear so as not to be confusing.

I am actually importing a text file. I am reading the lines and they are
goin into "sections".
For example section A may read: This is a test and it has a bold <b>
right</b> here.

It typically includes 10-20 lines of text.
I just need to look through that Section A and if it has a bold, mark it as such use sectionabold=Y

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:ui**************@TK2MSFTNGP11.phx.gbl...
Why don't you do it from the query?

It helps if you tell us which database you're using (see
http://www.aspfaq.com/5009), but for SQL Server:

SELECT hasabold = CASE WHEN CHARINDEX('<b>', column)>0 THEN 'Y' ELSE 'N'
END,
<otherstuff> FROM table

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Joey Martin" <ma******@bellsouth.net> wrote in message
news:Mu*********************@bignews4.bellsouth.ne t...

I know how to use the LIKE command in a query but how do I do it in the results of a recordset?

results="<b>Hello</b> World"

I want to search the above result and if it has a <B> in it, I want set hasabold="Y"
I need to be able to search through a large amount of text so the BOLD

marks
will not always be at the front of the results. They maybe be on line 50 character 59, etc....



Jul 19 '05 #4
Perfect. Thanks!
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:uN**************@TK2MSFTNGP09.phx.gbl...
So, look at the INSTR() function of VBScript...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Joey Martin" <ma******@bellsouth.net> wrote in message
news:9P********************@bignews6.bellsouth.net ...
Let me be more clear so as not to be confusing.

I am actually importing a text file. I am reading the lines and they are
goin into "sections".
For example section A may read: This is a test and it has a bold <b>
right</b> here.

It typically includes 10-20 lines of text.
I just need to look through that Section A and if it has a bold, mark it as
such use sectionabold=Y

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:ui**************@TK2MSFTNGP11.phx.gbl...
Why don't you do it from the query?

It helps if you tell us which database you're using (see
http://www.aspfaq.com/5009), but for SQL Server:

SELECT hasabold = CASE WHEN CHARINDEX('<b>', column)>0 THEN 'Y' ELSE 'N' END,
<otherstuff> FROM table

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Joey Martin" <ma******@bellsouth.net> wrote in message
news:Mu*********************@bignews4.bellsouth.ne t...
>
> I know how to use the LIKE command in a query but how do I do it in the > results of a recordset?
>
> results="<b>Hello</b> World"
>
> I want to search the above result and if it has a <B> in it, I want set > hasabold="Y"
> I need to be able to search through a large amount of text so the BOLD marks
> will not always be at the front of the results. They maybe be on
line 50 > character 59, etc....
>
>
>
>



Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: donald | last post by:
Hi all, I have a website running asp (about to move to asp.net soon though) which has a list of DVD's I have the various pages I want, last 10, listing, full listing ect, but the one page i can't...
1
by: Adrian | last post by:
This script works well for searching thru a SELECT list but doesnt work so well with the MULTIPLE option. I need to modify it to work for a SELECT MULTIPLE but I have no idea where to begin, any...
3
by: Stewart Allen | last post by:
Hi there I'm trying to find part serial numbers between 2 numbers. The user selects a part number from a combo box and then enters a range of serial numbers into 2 text boxes and the resulting...
5
by: justobservant | last post by:
When more than one keyword is typed into a search-query, most of the search-results displayed indicate specified keywords scattered throughout an entire website of content i.e., this is shown as...
7
by: pbd22 | last post by:
Hi. I am somewhat new to this and would like some advice. I want to search my xml file using "keyword" search and return results based on "proximity matching" - in other words, since the search...
8
by: Allan Ebdrup | last post by:
What would be the fastest way to search 18,000 strings of an average size of 10Kb, I can have all the strings in memory, should I simply do a instr on all of the strings? Or is there a faster way?...
4
by: dodjem | last post by:
Hi all, I am facing an issue which I really don't know how to solve after googling for quite some time. I have 2 tables: one is for my new articles and one is for the website content; I would...
1
by: kraj123 | last post by:
Hi Folks, I just need help like how to go with this ...... what should i go through to do this.....or in short can anyone guide me like psedocde for this...... It is like web searching...
11
by: KillSwitch | last post by:
Is it possible to make a program to search a site on the internet, then get certain information from the web pages that match and display them? Like, you would put in keywords to be searched for on...
2
by: Bart Kastermans | last post by:
I have a file in which I am searching for the letter "i" (actually a bit more general than that, arbitrary regular expressions could occur) as long as it does not occur inside an expression that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.