Hi,

I have a OleDbCommand select statement as [string sqlStatement = "SELECT *
FROM Contact WHERE Department LIKE '*" + strSearch + "*' ORDER BY
Contact.ContactId;";], which retrieve data from MS Access database. The
statement always return 0 record. But if I take out the two "*"s, then it
will return those correct records. I tested the sql statement with the two
"*"s in MS Access itself, and it work fine by returning correct records. I
don't understand why it won't work when it is in my web service.

Please help.

Thank you.

--
Soul

Q: OleDbCommand Select Statement by spl45h

spl45h
Thu Feb 05 03:48:26 CST 2004


>-----Original Message-----
>Hi,
>
>I have a OleDbCommand select statement as [string
sqlStatement = "SELECT *
>FROM Contact WHERE Department LIKE '*" + strSearch + "*'
ORDER BY
>Contact.ContactId;";], which retrieve data from MS Access
database. The
>statement always return 0 record. But if I take out the
two "*"s, then it
>will return those correct records. I tested the sql
statement with the two
>"*"s in MS Access itself, and it work fine by returning
correct records. I
>don't understand why it won't work when it is in my web
service.
>
>Please help.
>
>Thank you.
>
>--
>Soul
>

try '%' instead of '*'

Re: OleDbCommand Select Statement by Soul

Soul
Thu Feb 05 04:08:53 CST 2004

Thanks... it work!

--
Soul


"spl45h" <anonymous@discussions.microsoft.com> wrote in message
news:a98f01c3ebcd$33c70590$a401280a@phx.gbl...
|
| [Snipped]
|
| try '%' instead of '*'