Adding an existing table under transaction controlAn extra level of data integrity can be achieved when you add an existing table to a database under transaction control. When the transaction is committed, the database dictionary data for the table is committed to disk. If the transaction is aborted, the dictionary data for the table is automatically removed from the database dictionary. The code fragment below shows how to add an existing table under transaction control. // begin a transaction ADatabase.Begin(); try {
// add MyTable to the current database ADatabase.AddTable(“MyTable”, “”); // commit the transaction ADatabase.Commit(); } catch (CTException &err) {
// abort the transaction ADatabase.Abort(); printf(“Add table failed with code %d\n”, err.GetErrorCode()); } |
|||