procedure TForm1.CreateMyTable(NameFile: string);
begin
with Table1 do
begin
Active := False;
DatabaseName := '';
TableName := NameFile;
TableType := ttDefault;
with FieldDefs do
begin
Clear;
Add('EmpNo', ftInteger, 0, False);
Add('LastName', ftString, 20, False);
Add('FirstName', ftString, 15, False);
Add('PhoneExt', ftString, 4, False);
Add('HireDate', ftDateTime, 0, False);
Add('Salary', ftFloat, 0, False);
end;
with IndexDefs do
begin
Clear;
Add('', 'EmpNo', [ixPrimary, ixUnique]);
Add('ByName', 'LastName;FirstName', [ixCaseInsensitive]);
end;
CreateTable;
Free;
end;
end;
|