Errors linking SQL Server 7.0 table that has spaces in table name (245685)



The information in this article applies to:

  • Microsoft Access 97
  • Microsoft SQL Server 7.0

This article was previously published under Q245685
Moderate: Requires basic macro, coding, and interoperability skills.

SYMPTOMS

When you link SQL Server 7.0 tables that have one or more spaces in the table names, you may receive the following error message:
ODBC call failed.
When you check the ODBC log, you see that the call to SQLPrepare failed. This problem can also occur when you use other software such as MSQuery.

RESOLUTION

To work around this behavior, use one of the following methods.

Method 1

  1. Create a new system DSN for the SQL Server database, and make sure the Use ANSI quoted identifiers check box is not selected.
  2. Make sure the connect strings of the tables have quoted=no.
  3. Install the latest service pack for SQL Server 7.0.
  4. Install the latest version of Microsoft Data Access Components (MDAC) on both the client and the server. You can download MDAC from the following Microsoft Web site:
  5. Within SQL Server, run Instcat.sql from the latest version of MDAC on the server.

Method 2

Change any code and objects that use Data Access Objects (DAO) to use ODBCDirect instead.

Method 3

Remove the spaces from the names of the tables hosted by SQL Server.

Modification Type:MinorLast Reviewed:11/22/2005
Keywords:kberrmsg kbprb KB245685