Q: OleDbCommand Select Statement

  • Thread starter Thread starter Soul
  • Start date Start date
S

Soul

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.
 
-----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.

try '%' instead of '*'
 
Back
Top