BUG: DBGrid Does Not Insert Record if Field Name Contains DashLast reviewed: May 21, 1997Article ID: Q165432 |
The information in this article applies to:
SYMPTOMSWhen 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 near '-' CAUSEThis is occurs because the Remote Data Objects code is creating a SQL INSERT statement that doesn't put quotes around field names. The INSERT statement would look like:
INSERT INTO x (id, e-mail) VALUES (1, 'Eric')If RDO generated an INSERT statement that used double quotes around the field name, then the INSERT would work. The following syntax would work:
INSERT INTO x (id, "e-mail") VALUES (1, 'Eric') RESOLUTIONEither rename the field so that it doesn't contain a hyphen or do the updates manually (where the developer creates the proper SQL syntax).
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce Behavior
|
Additional query words: RDO DBGrid
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |