Article ID: 194678
Article Last Modified on 1/11/2006
class CMyTableAccessor
{
public:
LONG m_id; // This is an identity column
DWORD m_id_status; // Status variable for id column
TCHAR m_name[11];
BEGIN_COLUMN_MAP(CMyTableAccessor)
COLUMN_ENTRY_STATUS(1, m_id, m_id_status)
COLUMN_ENTRY(2, m_name)
END_COLUMN_MAP()
...
};
The code to add a new record to the table would resemble the following:
CMyTable rs;
rs.Open();
rs.ClearRecord(); //Null out current structure
strcpy(rs.m_name , "New Name");
rs.m_id_status = DBSTATUS_S_IGNORE; //Tells the provider to ignore this
// column when updating.
rs.Insert(); // Insert new record into the table letting server update
// of the identity column.
rs.Close();
Keywords: kbhowto kbprovider kbconsumer kbdatabase KB194678