Microsoft KB Archive/264687

From BetaArchive Wiki
Knowledge Base


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

Article ID: 264687

Article Last Modified on 3/14/2006



APPLIES TO

  • Microsoft SQL Server 7.0 Service Pack 2



This article was previously published under Q264687

BUG #: 57978(SQLBUG_70)

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.


Additional query words: invalid space colname identifiers quoted names

Keywords: kbbug kbfix kbqfe KB264687