Microsoft KB Archive/293821

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

Article ID: 293821

Article Last Modified on 5/17/2007

-

APPLIES TO


 * Microsoft Data Access Components 2.0
 * Microsoft Data Access Components 2.1
 * Microsoft Data Access Components 2.1 Service Pack 2
 * Microsoft Data Access Components 2.1 Service Pack 1
 * Microsoft Data Access Components 2.1 Service Pack 2

-



This article was previously published under Q293821



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 &quot;ODBC Call Failed&quot;.



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.



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:

http://msdn2.microsoft.com/en-us/data/aa937695.aspx



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).



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

Keywords: kbbug kbfix kbdatabase kbado250fix KB293821

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.