Microsoft KB Archive/937463

= Description of syntax changes for the db_column attribute in Visual C++ 2005 =

Article ID: 937463

Article Last Modified on 6/20/2007

-

APPLIES TO


 * Microsoft Visual C# 2005
 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual C# 2005 Express Edition

-





INTRODUCTION
This article describes the syntax changes that are required when you use the db_column attribute in Microsoft Visual C++ 2005.



MORE INFORMATION
In Microsoft Visual C++ .NET 2002 and in Microsoft Visual C++ .NET 2003, you can use syntax that resembles the following for the db_column attribute: [ db_column(1, status=m_dwProductIDStatus, length=m_dwProductIDLength) ] LONG m_ProductID; Because of a breaking design change in Visual C++ 2005, this syntax is not valid in Visual C++ 2005.

In Visual C++ 2005, an identifier is not treated as a string unless the following conditions are true:
 * The identifier is known during the code compile time.
 * The identifier is enclosed in quotation marks (&quot;).

The only exceptions are IDL attributes. In IDL attributes, all the contents are treated as strings. The contents do not require quotation marks (&quot;). For example, the uuid attribute does not require quotation marks.

In Visual C++ 2005, the syntax for the db_column attribute must resemble the following: [ db_column(ordinal=&quot;1&quot;, status=&quot;m_dwProductIDStatus&quot;, length=&quot;m_dwProductIDLength&quot;) ] LONG m_ProductID;

