473,498 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Searching a ASP database



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 figure out is a search page.

I have read various books, but none have given any tips on how to make a
search page for a access DB.

Could someone point me to a tutorial?

Thanks
Donald
Jul 19 '05 #1
4 1624
Hi Donald,

Searching a database is always done in SQL. To acheive a search on an
access database you would need to:

1) Create a search form
2) When the search is processed in the ASP code build up the SQL query
using operators such as LIKE, OR and AND.
3) Execute the query and return all the results.

So, you might for example have one textbox named 'searchtext'. Someone
might enter 'pulp fiction'. In the processing page you would do:

sqlvar = "SELECT * FROM tableFilms WHERE name LIKE '%" &
Request.form("searchtext") & "%'"

This would produce:

SELECT * FROM tableFilms WHERE name LIKE '%Pulp Fiction%'

Then, execute sqlvar on your database. This would return all records
where the name contains 'pulp fiction'. Check w3schools tutorials on
the LIKE comparison.

You can add more fields to your search form, like dates and one by one
process the search fields slowly building up the SQL query before execution.

Hope this helped,

Tom
Jul 19 '05 #2

"Thomas Gullen" <ad***@drum-world.com> wrote in message
news:41************@drum-world.com...
Hi Donald,

Searching a database is always done in SQL. To acheive a search on an
access database you would need to:

1) Create a search form
2) When the search is processed in the ASP code build up the SQL query
using operators such as LIKE, OR and AND.
3) Execute the query and return all the results.

So, you might for example have one textbox named 'searchtext'. Someone
might enter 'pulp fiction'. In the processing page you would do:

sqlvar = "SELECT * FROM tableFilms WHERE name LIKE '%" &
Request.form("searchtext") & "%'"

This would produce:

SELECT * FROM tableFilms WHERE name LIKE '%Pulp Fiction%'

Then, execute sqlvar on your database. This would return all records
where the name contains 'pulp fiction'. Check w3schools tutorials on
the LIKE comparison.

You can add more fields to your search form, like dates and one by one
process the search fields slowly building up the SQL query before execution.
Hope this helped,

Tom


Tom. do you have any tips for rating the results on the fly and showing the
most relevant results first?

mark
Jul 19 '05 #3
Define your "rating" system?
There is no criteria for relevancy either, it either matched or it didnt.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"mark | r" <ma******@gmail.com> wrote in message
news:41**********************@news.dial.pipex.com. ..

"Thomas Gullen" <ad***@drum-world.com> wrote in message
news:41************@drum-world.com...
Hi Donald,

Searching a database is always done in SQL. To acheive a search on an
access database you would need to:

1) Create a search form
2) When the search is processed in the ASP code build up the SQL query
using operators such as LIKE, OR and AND.
3) Execute the query and return all the results.

So, you might for example have one textbox named 'searchtext'. Someone
might enter 'pulp fiction'. In the processing page you would do:

sqlvar = "SELECT * FROM tableFilms WHERE name LIKE '%" &
Request.form("searchtext") & "%'"

This would produce:

SELECT * FROM tableFilms WHERE name LIKE '%Pulp Fiction%'

Then, execute sqlvar on your database. This would return all records
where the name contains 'pulp fiction'. Check w3schools tutorials on
the LIKE comparison.

You can add more fields to your search form, like dates and one by one
process the search fields slowly building up the SQL query before

execution.

Hope this helped,

Tom


Tom. do you have any tips for rating the results on the fly and showing
the
most relevant results first?

mark

Jul 19 '05 #4
[Answers Inline]

On Mon, 30 Aug 2004 13:53:06 +0100, "mark | r" <ma******@gmail.com>
wrote:

"Thomas Gullen" <ad***@drum-world.com> wrote in message
news:41************@drum-world.com...
Hi Donald,

Searching a database is always done in SQL. To acheive a search on an
access database you would need to:

1) Create a search form
2) When the search is processed in the ASP code build up the SQL query
using operators such as LIKE, OR and AND.
3) Execute the query and return all the results.

So, you might for example have one textbox named 'searchtext'. Someone
might enter 'pulp fiction'. In the processing page you would do:

sqlvar = "SELECT * FROM tableFilms WHERE name LIKE '%" &
Request.form("searchtext") & "%'"

This would produce:

SELECT * FROM tableFilms WHERE name LIKE '%Pulp Fiction%'

Then, execute sqlvar on your database. This would return all records
where the name contains 'pulp fiction'. Check w3schools tutorials on
the LIKE comparison.

You can add more fields to your search form, like dates and one by one
process the search fields slowly building up the SQL query before

execution.

Hope this helped,

Tom


Tom. do you have any tips for rating the results on the fly and showing the
most relevant results first?


Rating systems are tough because it depends on what you (or your user)
rates as higher than something else. For example, in a search of a
name, you're searching for:

Tom Jones

Define which of these is closer:

Thomas Jones
Tom Jonas
Tony Jones

You may say "Thomas Jones" and it's obvious to you. But "Tom Jonas"
has more matching letters, has more in the right places, is closer
alphabetically and wins all around. Tony Jones is actually closer
since it has a "To" and not a "Th" to start.

Might look at third party search products. :)

Jeff
Jul 19 '05 #5

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

Similar topics

2
2510
by: John | last post by:
Hi everyone ! This is a first time I post a message here. If I post my message in a wrong group. Please ignore it. I am trying to build a website which allows users (can be thousands of...
10
5458
by: sffan | last post by:
I am new to database programming and was curious how others solve the problem of storing encrypted in data in db table columns and then subsequently searching for these records. The particular...
1
1345
by: Lloyd Stevens | last post by:
Is there a way to peform a query search on a database where you type in a word to be searched across multiple fields? a bit like a search engine if you like. for example if searching a stock...
7
2194
by: Dan | last post by:
Hi. I'm having a problem with searching a databse entry. I'm new to dotnet and still trying to figure some things out. In order to locate a row in an access databse file .mdb, i am using this...
33
2430
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following...
3
2763
by: vonclausowitz | last post by:
Hi All, I was thinking of creating a table in my database to index all words in the database. That way I can quickly search for one or more words and the index table will return the words and...
0
1075
MMcCarthy
by: MMcCarthy | last post by:
There is a question in the Access forum you may be able to help with. I can move it over here if it is appropriate. http://www.thescripts.com/forum/thread598513.html Could you also check out...
1
1089
by: sirimanna | last post by:
Dear anyone I am developing a Visual Basic 6 application. I have a problem with linking and searching database. I have already linked my database but when i tried to search it to my application...
2
1167
by: thomson | last post by:
Hi All, i have a sit which deals with cars, and i have a table associated with this, i do have a problem in designing the application, i have lot of places in the web page where it hits the the...
3
1136
deepuv04
by: deepuv04 | last post by:
Hi, I have a table Users with the columns say UserName FirstName LastName City State Province Zip Country
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
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,...
1
6887
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
7379
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
4590
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
3093
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
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1419
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
656
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.