Article ID: 957387 - Last Review: November 17, 2008 - Revision: 2.0 FIX: No records may be returned when you call the SQLExecute function to execute a prepared statement and you use the SQL Native Client ODBC Driver in SQL Server 2008
Bug #: 50003391 (SQL Hotfix) On This PageSYMPTOMSYou use the SQL Native Client ODBC Driver in Microsoft SQL Server 2008. If you call the SQLExecute function to execute a prepared statement, no records may be returned. However, if you use the SQL Native Client ODBC Driver in SQL Server 2005 to call the SQLExecute function, records are returned. CAUSEThis problem may occur because of a bug in the SQL Native Client ODBC Driver in SQL Server 2008. It may occur if you call the SQLBindParameter function before each SQLExecute function. See the "More information" section for more information. RESOLUTIONCumulative update informationThe fix for this issue was first released in Cumulative Update 1. For more information about how to obtain this cumulative update package for SQL Server 2008, click the following article number to view the article in the Microsoft Knowledge Base:956717
(http://support.microsoft.com/kb/956717/
)
Cumulative update package 1 for SQL Server 2008
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 fix release. Microsoft recommends that you consider applying the most recent fix release that contains this hotfix.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:956909
(http://support.microsoft.com/kb/956909/
)
The SQL Server 2008 builds that were released after SQL Server 2008 was released
Hotfix informationA supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix. Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site: http://support.microsoft.com/contactus/?ws=support
(http://support.microsoft.com/contactus/?ws=support)
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.File informationThe English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.SQL Server 2008, 32-bit editionsCollapse this table
SQL Server 2008, 64-bit editionsCollapse this table
WORKAROUNDTo work around this problem, call the SQLBindParameter function one time. When you call the SQLBindParameter function, make sure that the following conditions are true:
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. MORE INFORMATIONThis problem occurs with the SQLBindParameter call. If the previous buffer matches the size of the following value length, a re-prepare of the statement is not issued. In the following example from an ODBC trace, the initial parameter's buffer matches the length of the following new parameter. Initial parameter: ec8-b6c EXIT SQLBindParameter with return code 0 (SQL_SUCCESS) Following new parameter: HSTMT 05A8E260 UWORD 1 SWORD 1 <SQL_PARAM_INPUT> SWORD -8 <SQL_C_WCHAR> SWORD -9 <SQL_WVARCHAR> SQLULEN 7 SWORD 0 PTR 0x028C8A98 SQLLEN 65535 SQLLEN * 0x050506F8 (14) ec8-b6c EXIT SQLBindParameter with return code 0 (SQL_SUCCESS) HSTMT 05A8E260 UWORD 1 SWORD 1 <SQL_PARAM_INPUT> SWORD -8 <SQL_C_WCHAR> SWORD -9 <SQL_WVARCHAR> SQLULEN 14 SWORD 0 PTR 0x028C4F80 SQLLEN 65535 SQLLEN * 0x050506F8 (28) REFERENCESFor more information about the SQLExecute function, visit the following Microsoft Developer Network (MSDN) Web site: http://msdn.microsoft.com/en-us/library/ms713584(VS.85).aspx
(http://msdn.microsoft.com/en-us/library/ms713584(VS.85).aspx)
For more information about the SQLBindParameter function, visit the following MSDN Web site: http://msdn.microsoft.com/en-us/library/ms710963(VS.85).aspx
(http://msdn.microsoft.com/en-us/library/ms710963(VS.85).aspx)
| Article Translations
|
Back to the top
