Re: String field contains "abc" using ASP to query Access database?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Noozer" <dont.spam@xxxxxxx> wrote in message
news:wPx9e.1084843$8l.642400@xxxxxxxxxxx
>
> "MGFoster" <me@xxxxxxxxxxx> wrote in message
> news:QLw9e.9496$An2.6439@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Not sure what problem is. I'd get rid of the "WHERE true" and just use
> >
> > WHERE Name LIKE '%S%'
>
> Unfortunately the WHERE clause is generated dynamically. Starting with
> "WHERE True" allows me to add more qualifiers to the query without a bunch
> of testing whether or not I've already added something.
>
> > I forgot you're using ASP & probably ADO. ADO uses the % in place of
> > the * wildcard.
>
> Ya..but still didn't work. I'll have to dig a bit deeper.

Not sure if this make a difference, but I change from

WHERE true AND Name LIKE '%S%'

....to...

WHERE (0=0) AND (Name LIKE '%S%')

Not sure what difference it makes but it works now.


.



Relevant Pages