Article ID: 165432 - View products that this article applies to.
This article was previously published under Q165432
This article has been archived. It is offered "as is" and will no longer be updated.
When you try to add a row to an SQL Server table using DBGrid bound to a Remote Data Control, you receive the following error message if one of the table's field names contains a "-":
ODBC error: 37000 [Microsoft][SQL Server Driver]Line2: Incorrect syntax
This problem occurs because the Remote Data Objects code is creating a SQL INSERT statement that doesn't put quotation marks around field names. The INSERT statement would resemble the following:
If RDO generated an INSERT statement that used double quotes around the field name, then the INSERT would work. The following syntax would work:
Either rename the field so that it doesn't contain a hyphen or do the updates manually (where the developer creates the proper SQL syntax).
This is by design. SQL Server does not support the use of dashes in its identifiers, including server names, database names, tables, views, columns, indexes, triggers, procedures, defaults, and rules.
Steps to Reproduce Behavior
Contact us for more help