ACC: "ODBC Call Failed" When Exporting Table to SQL Server

Last reviewed: May 20, 1997
Article ID: Q109341
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0

SYMPTOMS

Advanced: Requires expert coding, interoperability, and multiuser skills.

You receive the error message "ODBC - Call failed" when you export a Microsoft Access table to a SQL Server database using ODBC if the table field names are SQL reserved words. This error message is followed by another which reads:

   [Microsoft][ODBC SQL Server Driver][SQL Server] Incorrect syntax
   near the keyword '<keyword>'. (#156)

CAUSE

This problem will occur if the table you are exporting contains a field name that is also an SQL keyword. The Microsoft ODBC driver for SQL Server translates the export command into an SQL statement that can be interpreted by the SQL Server. If a field name in the Microsoft Access table is an SQL keyword, the SQL Server will interpret the field name as an SQL command keyword.

RESOLUTION

Rename the fields in the Microsoft Access table to non-SQL reserved words. Field names such as Order, In, From, or Where should not be used when you create Microsoft Access tables.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version 2.0. This problem no longer occurs in Microsoft Access version 7.0.

MORE INFORMATION

Steps to Reproduce Problem

  1. Create a new table with a field named Order.

  2. Save the table with the name Test Table.

  3. From the File menu, choose Export.

  4. In the Data Destination box select <SQL Database>, and then choose OK.

  5. In the Select Microsoft Access Object box, choose Test Table. Choose OK.

  6. In the Export dialog box, choose OK.

  7. In the SQL Data Sources dialog box, select a SQL Server. Choose OK.

  8. If necessary, log on to the SQL Server using the SQL Server Login dialog box.

    The error messages stated above will be displayed.


Keywords : kbusage OdbcOthr
Version : 1.0 1.1 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.