Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: ADO 2.0 Passes Invalid SQL Syntax to Data Source That Does Not Support Schema Separators


View products that this article applies to.

This article was previously published under Q293821

↑ Back to the top


Symptoms

If you use ActiveX Data Objects (ADO) 2.0 or 2.1 with an ODBC driver, when you access a database that does not support the schema names, you may receive syntax errors or error 3146 "ODBC Call Failed".

↑ Back to the top


Cause

ADO 1.5 submits the following query to the data source for processing:
SELECT * FROM CatalogName.TableName
				
ADO 2.0 and 2.1 include another period before the table name to accommodate the schema name for SQL-92 compliance as follows:
SELECT * FROM CatalogName.SchemaName.TableName
				
However, when no schema name is specified, the following syntax is generated:
SELECT * FROM CatalogName..TableName
				
In ODBC data sources that do not support schema names, this syntax is rejected as invalid, and an error results.

↑ Back to the top


Resolution

To resolve this problem, upgrade to Microsoft Data Access Components (MDAC) version 2.5 or later. You can download the latest version of MDAC from the following Microsoft Web site:

↑ Back to the top


Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Microsoft Data Access Components version 2.5 or later (in Msdasql.dll version 2.50.4403.0 or later).

↑ Back to the top


More information

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
243056� INFO: Using SchemaName and the SchemaSeparator in ODBC

↑ Back to the top


Keywords: KB293821, kbfix, kbdatabase, kbbug, kbado250fix

↑ Back to the top

Article Info
Article ID : 293821
Revision : 6
Created on : 5/17/2007
Published on : 5/17/2007
Exists online : False
Views : 293