Article ID: 194678 - View products that this article applies to.
This article has been archived. It is offered "as is" and will no longer be updated.
Note Microsoft Visual C++ .NET 2002 and Microsoft Visual C++ .NET 2003 support both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model. The information in this article applies only to unmanaged Visual C++ code. Microsoft Visual C++ 2005 supports both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model.
When using the OLE DB Templates with a SQL Server database, it is often necessary to add records to a table that contains an identity column.
Getting an identity column to increment properly with the OLE DB for ODBC provider that ships with Visual C++ 6.0, Msdasql.dll, requires that the COLUMN_ENTRY_STATUS macro be used.
The following sample code demonstrates how to use this macro when defining an accessor map with Visual C++ 6.0 OLE DB Consumer Templates:
The code to add a new record to the table would resemble the following:
Please see the following topics in MSDN online documentation:
Article ID: 194678 - Last Review: February 28, 2014 - Revision: 4.0