A table that is deleted from the database is eliminated from the database dictionary (the user is no longer able to open it) and also from disk. Use the following procedure to delete a table from a database:
The code excerpts below represent a table being deleted from a database at run time. There is no way to delete a table at design time. Do not delete a table physically from disk, since it will be kept in the database dictionary. This is the correct operation that should be done in order to remove a table from the database, and physically delete it from the disk.
Delphi Example
procedure Form1.DeleteTable();
begin
try
CtTable1.Table := 'MyTable';
CtTable1.Database := CtDatabase1;
CtTable1.DeleteTable();
except
on E : ECtError do
Application.ShowException(E);
end;
end;
C++ Example
void Form1::DeleteTable()
{
try
{
CtTable1->Table = "MyTable"
CtTable1->Database = CtDatabase1;
CtTable1->DeleteTable();
}
catch (ECtError& E)
{
Application->ShowException(&E);
}
}