sql_language thread: SV: Re: I donno how to use 'WHERE CONTAINS'...
Ssyntax error is due to '=' . When you use Like clause then no = is used.
Another thing use % sign instead of * otherwise it may not return any value.
It will look like this:-
SQL = "SELECT * FROM fusk WHERE spelnamn LIKE '%" & strKeyword & "%' ORDER
BY spelnamn ASC"
Good Luck!!!
Anita
At 12:28 PM 4/3/01 +0200, you wrote:
>Now here's the SQL string:
>SQL = "SELECT * FROM fusk WHERE spelnamn LIKE = '*" & strKeyword & "*' ORDER
>BY spelnamn ASC"
>
>And here's the error message:
>[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
>query expression 'spelnamn LIKE = '*AOE*''.
>--
>Martin Johansson,
>CEO & Project Supervisor
>Sola Data
>http://www.sd-studios.com
>http://www.sd-gaming.com
>
>
>-----Ursprungligt meddelande-----
>Fran: John Pirkey [mailto:mailjohnny101@y...]
>Skickat: den 2 april 2001 23:04
>Till: sql language
>Amne: [sql_language] Re: I donno how to use 'WHERE CONTAINS'...
>
>
>Replace the CONTAINS word with "LIKE" and place * around the keyword as
>well - so
>your WHERE looks like this:
>
>SQL = "SELECT * FROM fusk WHERE spelnamn LIKE = '*" & strKeyword & "*'
> ORDER BY spelnamn ASC"
>
>--- SD-Studios <info@s...> wrote:
> >
> > I try using this sting...but i get an error message. Its the first time I
> > use it and i dont know where to put everything..=)
> >
> > SQL = "SELECT * FROM fusk WHERE spelnamn CONTAINS = '" & strKeyword & "'
> > ORDER BY spelnamn ASC"
> >
> > Can someone please help me out?
> > --
> > Martin Johansson,
> > CEO & Project Supervisor
> > Sola Data
> > http://www.sd-studios.com
> > http://www.sd-gaming.com
> >
> >
>=====
>
>----------------------------
>John Pirkey
>MCSD
>John@S...
>http://www.stlvbug.org
>
>