LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

database wild card

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.

0 Kudos
Message 1 of 6
(3,220 Views)
Try using a % for the wildcard.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 6
(3,209 Views)
% inside single quotes works.  Any other wildcard characters work inside single quotes?  Is this documented anyplace?  Thanks.
0 Kudos
Message 3 of 6
(3,198 Views)

Actually, the % is the SQL standard wildcard for use in LIKE clauses. I'm surprised that something else worked at all...

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 6
(3,196 Views)
Hi Ken, does using two ticks('') instead of the double quotes (") work in getting the wildcard to go through?
Joshua B.
National Instruments
0 Kudos
Message 5 of 6
(3,160 Views)

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.

0 Kudos
Message 6 of 6
(3,145 Views)