LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in executing SQL query

Hi All,
 
I am working with labview application.
The database being used is Access.
 
The tables i have to use contains the special symbol -   (not underscore.)
Let the table name be user-data
When i am executing the query select * from user-data its showing
error message syntax error in from clause.
I tried just typing the query in access also and got the same error.
 
I believe its because of the usage of the special character other than underscore in table name
 
Many applications using the same database is running in VB already.So there is no way for me to rename the table.
 
I know i am asking an invalid question.But still....
Is there any way for me to use the same table name and execute sql query.
 
Thanks in advance
0 Kudos
Message 1 of 5
(3,052 Views)
There should be. Try putting the table name in quotes - some DBMS use single quotes, some use double quotes. For example say the table name has a space in it. Try something like:

select * from 'a funny table';

or

select * from "a funny table";   (Actually, I think I'd try this one first...)

Failing this, you have two choices: change the name of the table, or dump Access and go with a real DBMS - which you will probibly want to do anyway because it will only be a matter of time before you start hitting a performance wall. Access is particularly bad if you have more than one process making a connection to it at a time. Interms of alternatives, there are a couple really good open-source products out there, as well as no-cost versions of Oracle and SQL-Server.

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 2 of 5
(3,048 Views)
I believe you would need to use:

SELECT * FROM [a funny table]

At least that's what it is in SQL Server. Not sure how TSQL-compatible Access is.
0 Kudos
Message 3 of 5
(3,033 Views)
Actually, I think you may be right. I seem to recall seeing that syntax.

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 5
(3,026 Views)
Hi,
 
Thanks for the replies and help.
 
Its working if i am enclosing the table name in in a pair of braces(ie,[funny table]).
 
Thanks once again
0 Kudos
Message 5 of 5
(3,007 Views)