|
 |
asp_databases thread: Re: Searching Memo Field
Message #1 by lee@c... on Tue, 9 Oct 2001 18:39:46
|
|
This is EXACTLY what I'm looking to do.
SQL Server has Full Text Search capacbility - I'm beginning to think that
there's nothing in Access.
> What I want to do is search a memo field in Access for certain keywords.
> Would like to know if it´s possible and if positive how I can do it using
> ASP.
>
> Supose I have a record with the words apple orange red yellow.
> Other record is filled with pineapple strawberry red blue.
>
> Using a text field in a asp page I´d type red and the search would return
> all the records with red in the memo field.
>
> Thanks.
Message #2 by "Peter Foti (PeterF)" <PeterF@S...> on Tue, 9 Oct 2001 14:04:30 -0400
|
|
It's easy. Just write a SQL command and put the results into a
recordset.
The SQL string would look something like this:
SQLStr =3D "SELECT MyMemoField FROM MyTable WHERE MyMemoField LIKE
'*red*'"
I think that's right. Note that the wildcard characters are different
in Access and SQL Server. One of them uses * and the other uses %.
Good luck,
Pete
> -----Original Message-----
> From: lee@c... [mailto:lee@c...]
> Sent: Tuesday, October 09, 2001 6:40 PM
> To: ASP Databases
> Subject: [asp_databases] Re: Searching Memo Field
>
>
> This is EXACTLY what I'm looking to do.
>
> SQL Server has Full Text Search capacbility - I'm beginning
> to think that
> there's nothing in Access.
>
> > What I want to do is search a memo field in Access for
> certain keywords.
> > Would like to know if it=B4s possible and if positive how I
> can do it using
> > ASP.
> >
> > Supose I have a record with the words apple orange red yellow.
> > Other record is filled with pineapple strawberry red blue.
> >
> > Using a text field in a asp page I=B4d type red and the
> search would return
> > all the records with red in the memo field.
> >
> > Thanks.
Message #3 by David Cameron <dcameron@i...> on Wed, 10 Oct 2001 11:00:32 +1000
|
|
I think that the problem you will run into will be when you have more
than
one word. What happens if people enter keywords 'tree' and 'apple'? If
you
use you solution then you generate a SQL string like this:
SQLStr =3D "SELECT MyMemoField FROM MyTable WHERE MyMemoField LIKE
'*tree*apple*'"
What happens if the order of the words is apple *then* tree? Your
search
would not return the results. IMO you need to write some code to
generate an
AND to the where clause for each word. SQL string becomes:
SQLStr =3D "SELECT MyMemoField FROM MyTable WHERE MyMemoField LIKE
'*tree*' AND myMemoField LIKE '*apple*'"
regards
David Cameron
nOw.b2b
dcameron@i...
-----Original Message-----
From: Peter Foti (PeterF) [mailto:PeterF@S...]
Sent: Wednesday, 10 October 2001 4:05 AM
To: ASP Databases
Subject: [asp_databases] Re: Searching Memo Field
It's easy. Just write a SQL command and put the results into a
recordset.
The SQL string would look something like this:
SQLStr =3D "SELECT MyMemoField FROM MyTable WHERE MyMemoField LIKE
'*red*'"
I think that's right. Note that the wildcard characters are different
in Access and SQL Server. One of them uses * and the other uses %.
Good luck,
Pete
|
|
 |