473,387 Members | 1,574 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,387 software developers and data experts.

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 1618
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
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
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
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
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
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.