|
 |
access_asp thread: keyword search
Message #1 by jake williamson 28 <jake.williamson@2...> on Thu, 11 Apr 2002 14:47:40 +0100
|
|
i'm sure this is simple but it just ain't working...
i want to be able to do a search that finds keywords in a database column.
for example i want a pop up saying:
Street
Leisure
Off Road
in my database i need a column that i can put these keywords in, for
example:
BIKE STYLE
bike one Street, Leisure
bike two Off Road
bike three Off Road, Street
where BIKE and STYLE are column's
so i want the sql to say:
select BIKE where STYLE like 'popup menu'
so if i select Street and submit i get 'bike one and two', if i select
leisure i get 'bike one'.
i'm pretty sure i use the 'LIKE'...
but it ain't working! how do i enter the 'keywords' into the database
column? should they be separated by a comma??
any pointers would be grand,
cheers,
jake
Message #2 by "Rob Parkhouse" <rparkhouse@o...> on Fri, 12 Apr 2002 00:28:20
|
|
I assume your asp/html has a SELECT tag with the styles as options (is
this what you mean by pop up). Say the SELECT tag field name is "Style".
When you submit the form the asp would generate sql like:
"SELECT Bike WHERE Style Like '%" & Request.Form("Style") & "%'"
Hope this helps
> i'm sure this is simple but it just ain't working...
i want to be able to do a search that finds keywords in a database column.
for example i want a pop up saying:
Street
Leisure
Off Road
in my database i need a column that i can put these keywords in, for
example:
BIKE STYLE
bike one Street, Leisure
bike two Off Road
bike three Off Road, Street
where BIKE and STYLE are column's
so i want the sql to say:
select BIKE where STYLE like 'popup menu'
so if i select Street and submit i get 'bike one and two', if i select
leisure i get 'bike one'.
i'm pretty sure i use the 'LIKE'...
but it ain't working! how do i enter the 'keywords' into the database
column? should they be separated by a comma??
any pointers would be grand,
cheers,
jake
Message #3 by "Ken Schaefer" <ken@a...> on Sat, 13 Apr 2002 16:42:12 +1000
|
|
<%
strSQL
"SELECT Bike " & _
"FROM table1 " & _
"WHERE Style LIKE '%" & strCriteria & "%'"
%>
strCriteria you get from however the user enters the criteria (eg the
Request.Form or Request.QueryString collections)
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "jake williamson 28" <jake.williamson@2...>
Subject: [access_asp] keyword search
: i'm sure this is simple but it just ain't working...
:
: i want to be able to do a search that finds keywords in a database column.
: for example i want a pop up saying:
:
: Street
: Leisure
: Off Road
:
: in my database i need a column that i can put these keywords in, for
: example:
:
: BIKE STYLE
: bike one Street, Leisure
: bike two Off Road
: bike three Off Road, Street
:
: where BIKE and STYLE are column's
:
: so i want the sql to say:
:
: select BIKE where STYLE like 'popup menu'
:
: so if i select Street and submit i get 'bike one and two', if i select
: leisure i get 'bike one'.
:
: i'm pretty sure i use the 'LIKE'...
:
: but it ain't working! how do i enter the 'keywords' into the database
: column? should they be separated by a comma??
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
 |