Applies To:
  • CitectSCADA 1.xx, 2.xx, 3.xx, 4.xx, 5.xx

Summary:
When I use the SQL SELECT statement on a table that has spaces in the name I get an error such as:

Error 307: DESC: SQL database error
ERRPAGE: SQLExec()
ERRDESC: 3506 [Microsoft][ODBC Microsoft Access 97 Driver] Syntax error

 

Solution:
This can be caused by using a command such as:

SQLExec(hSQL, "SELECT Field1 FROM My Table")

If the table name has spaces in it, it must be enclosed in square brackets, for example:

SQLExec(hSQL, "SELECT Field1 FROM [My Table]")


Keywords:
 

Attachments