FIX: ADO Applications Report a Syntax Error When Column Names Contain Spaces

Article translations Article translations
Article ID: 264687 - View products that this article applies to.
This article was previously published under Q264687
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 57978(SQLBUG_70)
Expand all | Collapse all

SYMPTOMS

After you apply Microsoft SQL Server Service Pack 2, Microsoft ActiveX Data Objects (ADO) applications that attempt to update a row in a rowset fail if you are using a server-side cursor and the column name contains spaces. The error message that occurs is:
0x80004005 (-2147467259) "Incorrect syntax near ..."
When you use ODBCDirect the following SQL Server error messages occur:
Msg 170 37000: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'nvarchar'.
Msg 137 37000: [Microsoft][ODBC SQL Server Driver][SQL Server]Must declare the variable '@Session'.
3146 ODBC--call failed.

CAUSE

This problem is due to a change in processing updates with sp_cursor calls in SQL Server 7.0 Service Pack 2.

WORKAROUND

You can use either of the following workarounds:
  • Use client side cursors in your application instead of using server-side cursors.

  • Change the column names so that the column names do not have spaces. For example, instead of "Customer Name" use "CustomerName."

STATUS

Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
274799 INF: How to Obtain Service Pack 3 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.

Properties

Article ID: 264687 - Last Review: February 28, 2014 - Revision: 5.0
APPLIES TO
  • Microsoft SQL Server 7.0 Service Pack 2
Keywords: 
kbnosurvey kbarchive kbbug kbfix kbqfe KB264687

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com