Updatable Property Example (VC++)

This example adds a record to a Recordset object if the object's Updatable property setting is True.

CdbDBEngine      dbeng;
CdbDatabase      dbsNorthwind;
CdbRecordset   rstUnknown;

dbsNorthwind = dbeng.OpenDatabase(_T("Northwind.mdb"));
rstUnknown = 
   dbsNorthwind.OpenRecordset(_T("Unfamiliar Table"));
if (rstUnknown.GetUpdatable())
{
   rstUnknown.AddNew();
   rstUnknown.SetField(_T("MyField"), 
               &COleVariant(_T("Some new data")));
   rstUnknown.Update();
}
dbsNorthwind.Close;