FIX: SQLTables() with a Server-Side Cursor Returns No Data (315761)
The information in this article applies to:
- Microsoft ODBC Driver for SQL Server 3.7
- Microsoft ODBC Driver for SQL Server 2.0
- Microsoft ODBC Driver for SQL Server 2.5
- Microsoft ODBC Driver for SQL Server 2.65
- Microsoft ODBC Driver for SQL Server 2.65.0212
- Microsoft ODBC Driver for SQL Server 2000.80.194
- Microsoft ODBC Driver for SQL Server 3.0
- Microsoft ODBC Driver for SQL Server 3.5
- Microsoft ODBC Driver for SQL Server 3.6
- Microsoft Data Access Components 1.5
- Microsoft Data Access Components 2.0
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.6 SP1
- Microsoft Data Access Components 2.6 SP2
- Microsoft Data Access Components 2.7
This article was previously published under Q315761 SYMPTOMS
When you open a server-side cursor and call the SQLTables or SQLTablesW function against a Microsoft SQL Server database whose name contains an underscore (_), the SQL Server ODBC driver generates SQL_SUCCESS_WITH_INFO with the following message:
"[Microsoft][ODBC SQL Server Driver][SQL Server]Unknown sp_ddopen procedure"
When you call the SQLFetch or SQLExtendedFetch function, no data is returned.
You may see similar behavior when you pass a wildcard character (%) as the database name to obtain the results associated with all databases.
CAUSE
In the preceding scenario, the following remote procedure call (RPC) is generated by the SQL Server driver:
exec sp_ddopen @P1 output, N'sp_tableswc', @P2 output, @P3 output, @P4 output, NULL, N'%', N'Cust_DB', NULL
However, the current system stored procedure sp_ddopen (which is supplied by Instcat.sql or which comes with SQL Server by default) does not account for the sp_tableswc stored procedure. NOTE: "Cust_DB" is a sample database name with an underscore.
RESOLUTIONA supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Data Access Components service pack that contains this hotfix. To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site: NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
The English version of this fix should have the following file attributes or later:
Date Size File name
------------------------------------------------------------
13-DEC-2001 936,920 Instcat.sql
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. REFERENCESFor additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
294875 FIX: SQLTables() Function Returns No Data for SQL Server Database Names That Contain Underscore
To obtain the ODBCTest tool that ships with the MDAC SDK, see the following Microsoft Web site:
Modification Type: | Minor | Last Reviewed: | 10/12/2005 |
---|
Keywords: | kbHotfixServer kbQFE kbBug kbfix KB315761 |
---|
|