473,513 Members | 2,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to create a searh in a database field?

Hello,

I need to create a simple search in a web site.

I have an input text where the user writes the words for search.

When it clicks the "search" button a new page will appear with all the
records of the database which TITLE field includes those words.

Well, if this would be just one word i would send that word in the URL
and i would create an SQL filter in the new page...that would be simple.

Anyway, can somebody help me out?

I am working in ASP.Net / VB with Microsoft SQL 2000 database.

Thanks,
Miguel

Nov 18 '05 #1
3 1083
Do you want to know how to build the SQL string, or how to pass multiple
words between pages?

For SQL, it might end up looking like

select <fieldlist> from tablename where title like '%word1%' or title like
'%word2%'.

I'm hoping someone else has a routine in mind to parse a variable number of
words into the proper SQL syntax :-)

Jeff

"Miguel Dias Moura" <we****@27lamps.com> wrote in message
news:OV**************@TK2MSFTNGP11.phx.gbl...
Hello,

I need to create a simple search in a web site.

I have an input text where the user writes the words for search.

When it clicks the "search" button a new page will appear with all the
records of the database which TITLE field includes those words.

Well, if this would be just one word i would send that word in the URL
and i would create an SQL filter in the new page...that would be simple.

Anyway, can somebody help me out?

I am working in ASP.Net / VB with Microsoft SQL 2000 database.

Thanks,
Miguel

Nov 18 '05 #2
Hi,

What I need is to know how to identify the different words in the input
text and pass them to the next page in the URL.

The SQL you mention should work for 2 words...but for more words how it
would be?

The words inserted in the input text might be a number of 1, 2, 3, ...

Thanks,
Miguel

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:je**@removeemergencyreporting.com:
Do you want to know how to build the SQL string, or how to pass multiple

words between pages?

For SQL, it might end up looking like

select <fieldlist> from tablename where title like '%word1%' or title like

'%word2%'.

I'm hoping someone else has a routine in mind to parse a variable number
of
words into the proper SQL syntax :-)

Jeff

"Miguel Dias Moura" <we****@27lamps.com> wrote in message
news:OV**************@TK2MSFTNGP11.phx.gbl...
Hello,

I need to create a simple search in a web site.

I have an input text where the user writes the words for search.

When it clicks the "search" button a new page will appear with all the
records of the database which TITLE field includes those words.

Well, if this would be just one word i would send that word in the URL
and i would create an SQL filter in the new page...that would be
simple.

Anyway, can somebody help me out?

I am working in ASP.Net / VB with Microsoft SQL 2000 database.

Thanks,
Miguel


Nov 18 '05 #3
Yes, I understand there may be more than one word.

I would suggest POST'ing to the next page, instead of a query string. Or
consider using Server.URLEncode for a string of words with spaces in the URL

Jeff

"Miguel Dias Moura" <we****@27lamps.com> wrote in message
news:OK**************@TK2MSFTNGP12.phx.gbl...
Hi,

What I need is to know how to identify the different words in the input
text and pass them to the next page in the URL.

The SQL you mention should work for 2 words...but for more words how it
would be?

The words inserted in the input text might be a number of 1, 2, 3, ...

Thanks,
Miguel

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:je**@removeemergencyreporting.com:
Do you want to know how to build the SQL string, or how to pass multiple

words between pages?

For SQL, it might end up looking like

select <fieldlist> from tablename where title like '%word1%' or title like
'%word2%'.

I'm hoping someone else has a routine in mind to parse a variable number
of
words into the proper SQL syntax :-)

Jeff

"Miguel Dias Moura" <we****@27lamps.com> wrote in message
news:OV**************@TK2MSFTNGP11.phx.gbl...
Hello,

I need to create a simple search in a web site.

I have an input text where the user writes the words for search.

When it clicks the "search" button a new page will appear with all the
records of the database which TITLE field includes those words.

Well, if this would be just one word i would send that word in the URL
and i would create an SQL filter in the new page...that would be
simple.

Anyway, can somebody help me out?

I am working in ASP.Net / VB with Microsoft SQL 2000 database.

Thanks,
Miguel

Nov 18 '05 #4

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

Similar topics

3
5365
by: Richard Fritzler | last post by:
I was given the task of designing a complete web based document prep system. In simplest terms (using a msword explanation) create a database of merge fields, and a library of templates. Allow the...
4
5995
by: Melissa | last post by:
I have a frontend file named CustomerApp and backend file named CustomerData. CustomerApp is at C:\Customer Database and CustomerData is at S:\Customer Database. Could someone help me with the code...
4
2523
by: John T. Howard | last post by:
Can you issue commands from VB.Net to create and delete databases? I would like to create, delete, and copy MSAccess tables and/or databases from code. Can this be done? Can you show, or point...
4
1743
by: Steven | last post by:
Hi, I have a database table field to store the form name, I want to create the particular windows form by using the value that read from that DB field. For examples, the table field has a value...
27
3744
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
4
12416
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
4
2315
by: Priya | last post by:
Hey all, Is there a way to create a table in the SQL database by using an XML file as an input? I want to have an XML file which holds all the details of the table like the tablename, columns,...
15
5241
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
3
7174
by: DeanL | last post by:
Hi guys, Does anyone know of a way to create multiple tables using information stored in one table? I have a table with 4 columns (TableName, ColumnName, DataType, DataSize) and wanted to know...
0
7267
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,...
1
7120
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
7542
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...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3247
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.