ADO Query kills the Wildcard in LIKE stmt
Hi all;
I'm working with VC++ OLEDB ADO connecting to an Access database, my problem is in the Query I have wildcards with a LIKE statement but either OLEDB is not passing wildcards or Access ignoring the wildcards in a LIKE statement.
This will work and find only exact part number input.
sprintf(szPartial, "SELECT * FROM [parts] WHERE [partno] LIKE '%s'", (LPCSTR)csInput);
This will NOT (added * to like statement) work and find NO part number matches from input.
sprintf(szPartial, "SELECT * FROM [parts] WHERE [partno] LIKE '%s*'", (LPCSTR)csInput);
I have viewed the "szPartial" string in the debugger and all the char's are there, there is no stripping of char's in the sprintf function.
Neither VC++ or OLEDB/Access kicks up a syntax error or any error at all they just seem to ignore any wildcards in the SQL statement.
Has anyone seen this kind of problem from OLEDB ADO?
Thanks in advance
J.R.
|