01-31-2009 12:10 PM
I am having trouble using wildcard matching in database toolkit queries. When working directly in Microsoft Access a query using the expression Like "File*" returns the expected data but when sent through the tool kit results in an error complaining about illegals characters.
Error -2147217904 occurred at Conn Execute.vi->DB Tools Select Data.vi->SQL_like.vi
Possible reason(s):
. Invalid string: specified field does not exist or contains an unsupported character
If I replace "File*" with 'File*' then no no error occurs but no results are returned because, presumably, the * is no longer treated as a wildcard.
01-31-2009 03:52 PM
01-31-2009 07:52 PM
01-31-2009 08:02 PM
Actually, the % is the SQL standard wildcard for use in LIKE clauses. I'm surprised that something else worked at all...
Mike...
02-02-2009 03:42 PM
02-02-2009 11:13 PM
Using double ticks producing a slightly different error message:
Error -2147217900 occurred at Conn Execute.vi->DB Tools Select Data.vi->SQL_like.vi
Possible reason(s):
Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'item Like ''C*'''. in Conn Execute.vi->DB Tools Select Data.vi->SQL_like.vi
The outermost ticks were added by the error processing. The double inner ticks ''C*'' are mine.