Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTTable::Remove

Removes any c-treeDB table.

Declaration

void CTTable::Remove();

Description

The CTTable::Remove() function allows any table to be deleted, including tables that are not members of a database.

The CTTable::Remove() function deletes a c-tree data file and the associated index files from disk. If the table was opened under a database handle, the table is closed and CTDatabase::DeleteTable() is called. If the handle is not active, the table is opened exclusive and then deleted. If the table handle is not active, you must set the path, file extension and password for the handle before calling the RemoveTable() method.

A CTException is thrown when an error occurs. Use CTException::GetErrorCode() and CTException::GetErrorMsg() to retrieve the error code and descriptive message.

Return

void

Example


/* delete a c-treeDB Table */

try {

MyTable.Remove();

}

catch(CTException &E) {

printf("MyTable.Remove error: (%d) - %s\n", E.GetErrorCode(),

E.GetErrorMsg());

}

See Also

CTDatabase::DeleteTable()

TOCIndex