Indicates whether the underlying database table exists.
Syntax:
property Exists: Boolean;
Description:
Example:
// Don't overwrite an existing table
if not MySQLTable1.Exists then
begin
with MySQLTable1 do begin
// The Table component must not be active
Active := False;
// First, describe the type of table and give
// it a name
DatabaseName := 'DBDEMOS';
TableName := 'CustInfo';
// Describe the fields in the table
with FieldDefs do begin
Clear;
with AddFieldDef do begin
Name := 'Field1';
DataType := ftInteger;
Required := True;
end;
with AddFieldDef do begin
Name := 'Field2';
DataType := ftString;
Size := 30;
end;
end;
// Describe any indexes
with IndexDefs do begin
Clear;
with AddIndexDef do begin
Name := '';
Fields := 'Field1';
Options := [ixPrimary];
end;
with AddIndexDef do begin
Name := 'Fld2Indx';
Fields := 'Field2';
Options := [ixCaseInsensitive];
end;
end;
// Call the CreateTable method to create the table
CreateTable;
end;
end;