Indicates whether the underlying database table exists.
Syntax:
property Exists: Boolean;
Description:
Example:
// Don't overwrite an existing table
if not PSQLTable1.Exists then
begin
with PSQLTable1 do begin
// The Table component must not be active
Active := False;
// Define table's type and name
DatabaseName := 'DBDEMOS';
TableName := 'CustInfo';
// Define table's fields
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;
// Define 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;
// Create the table
CreateTable;
end;
end;