Deleting a tableWhen you delete a table from a database, the table information is removed from the database dictionary and the table data and index files are deleted from disk. The delete table operation can be reversed only when used under transaction control. Without transaction control, a delete table operation will delete the data and index files and the table data will be lost. Delete a table from a database by calling CTDatabase::DeleteTable() method. Example: // delete MyTable from current database try {
CTString password; ADatabase.DeleteTable(“MyTable”, password); } catch (CTException &err) {
printf(“Delete table failed with code %d\n”, err.GetErrorCode()); } Note: The DeleteTable() method takes as parameters the table name and the table password. Set the password parameter to an empty CTString object if a table was created without passwords. |
|||