Use the update table create mode property to change the table create mode after the table has been created. Use the function CTTable.UpdateCreateMode() to change the table create mode. You can only update the create mode if the table was opened in exclusive mode.
// create a new table object
CTTable ATable = new CTTable(ADatabase);
// open the table exclusive
ATable.Open("MyTable", OPEN_MODE.EXCLUSIVE_OPEN);
// update the table create mode
try
{
// retrieve the current create mode
CREATE_MODE curmode = ATable.GetCreateMode();
// add transaction processing
curmode |= CREATE_MODE.TRNLOG_CREATE;
// update the table create mode
ATable.UpdateCreateMode(curmode);
}
catch (CTException err)
{
Console.Write("Update create mode failed with error {0}\n", err.GetErrorCode());
}
CTTable.UpdateCreateMode() changes critical file mode attributes such as the level of transaction control. No check is made to determine if the mode change will damage data. No check is made if the new mode is valid. Use this function with caution as data may be lost. For instance, changing a data file from transaction processing to no transaction processing makes automatic recovery unavailable.
The mode parameter passed to CTTable.UpdateCreateMode() represents the new table create mode. It must be perfectly formed, as it will replace the current table create mode. Use the function CTTable.GetCreateMode() to retrieve the current create mode and apply the changes on a fully qualified create mode. Update only the following create table modes: