Syntax question..

bornbroke
01-28-2005, 07:59 AM
Hi,
Has anybody have had a problem with the SELECT statement when the table name has a "-" character? I've been searching for SQL tutorials, but none mention any restrictions.

the table I'm calling from the .mdb file is spA-ProblemTitle, and the error I'm getting is "Error 5 Syntax error in From clause".

If a "-" is not permitted by the SELECT statement, is there a way to go around this problem? For I'm upgrading an old application, and it would be impossible to change all the databases out there in current use. For your info, the previous code used DAO and did not have problems opening the data tables.

I would appreciate the help. Thanks.

00100b
01-28-2005, 08:08 AM
Try wrapping the reference in square brackets.

ie

SELECT * FROM [spA-ProblemTitle]


As it stands, the reference is being interpretted as a mathematical equation.

bornbroke
01-28-2005, 08:19 AM
Thank you so much!!!!!

I've been stuck with this all day yesterday...

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum