LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parameterized query format for select statement

Perhaps try taking the carriage returns out of the SQL select statement.....

0 Kudos
Message 21 of 27
(957 Views)

Just tried it with no carriage returns - just one line.  I get the same error.

0 Kudos
Message 22 of 27
(954 Views)

Are you sure that your first column name is a valid name?

Try to remove that from the SQL statement.. 

Message 23 of 27
(943 Views)

Good call.  So the column name can't begin with a number?

0 Kudos
Message 24 of 27
(940 Views)

It appears that the @ symbol is not needed if you are accessing an Access 2016 database.  It also appears that enclosing the parameter in the sql statement isn't a must.  I don't know if this is true for earlier versions of Access.  These parameterized Access 2016 database queries work for me.  It appears that my problem was starting a column name with a number.  Also, I believe if the column name has spaces in it, you need to put the column name in square brackets (e.g. [First Sample ID]).

Thanks everyone for the help and for posting the initial solution.  I would still be trying to figure this out if it wasn't for the help.

 

ParamQuery001b.JPG

 

ParamQuery001c.JPG

0 Kudos
Message 25 of 27
(932 Views)

Sorry for the multiple posts.

Even this works with parameterized sql queries to Access 2016 databases.ParamQueryFinal.JPG

0 Kudos
Message 26 of 27
(909 Views)

One of the things to remember is that parameterized queries are not standardized between platforms: everyone does it different​ and as in the case of Microsoft can change it at anytime.


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 27 of 27
(899 Views)