Symptoms
Consider the following scenario:
-
You develop a Microsoft Foundation Class (MFC) application in Microsoft Visual Studio 2010.
-
The MFC application uses Open Database Connectivity (ODBC) to connect to a Microsoft SQL Server database.
-
You use a Microsoft SQL Server Native Client driver to configure the ODBC data source.
-
You run the MFC application.
-
The application tries to update a record in the database.
In this scenario, you receive the following error message:
Invalid Cursor Name
Cause
This issue occurs because an ODBC driver generates a cursor name that is longer than the maximum length limit of the fixed-size buffer in the CRecordset::BuildUpdateSQL() method. Therefore, the stored cursor name is truncated.
When the driver tries to reference a cursor by the nonexistent name, the ODBC driver uses the truncated stored name and generates an error.Resolution
To resolve this issue, apply the following hotfix. After you apply the following hotfix, MFC checks whether the cursor name is within the maximum length limit of the fixed-size buffer when MFC stores the cursor name. If the cursor name is too long, MFC allocates a larger buffer and stores the cursor name in that buffer.
Hotfix information
A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that is described in this article. Apply it only 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 software update that contains this hotfix.
To resolve this problem immediately, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft website:http://support.microsoft.com/contactus/?ws=supportNote 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 usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
Prerequisites
To apply this hotfix, you must have the Microsoft Visual Studio 2010 Service Pack 1 (SP1) installed.
Restart requirement
You must restart the computer after you apply this hotfix if the affected files are being used.
We recommend that you close all instances of Visual Studio before you apply this hotfix.Hotfix replacement information
This hotfix does not replace a previously released hotfix.
File information
The 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.
File name |
File version |
File size |
Date |
Time |
---|---|---|---|---|
Vcredist_ia64.exe |
10.0.40219.312 |
3,013,632 |
27-Apr-2011 |
03:05 |
Vcredist_x64.exe |
10.0.40219.312 |
10,253,312 |
27-Apr-2011 |
03:05 |
Vcredist_x86.exe |
10.0.40219.312 |
8,962,048 |
27-Apr-2011 |
03:05 |
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.