Delphi Database, Delphi Components from ComponentAce
Products Download Order Contact us
Restructuring Tables
Previous  Top  Next

Use Absolute Database DBManager utility (...\AbsoluteDatabase\Ultils\Bin\DBManager.exe), if you would like to change table structure manually.

To alter table from your application using TABSTable component, you could perform the following steps:

1.Open existing table to fill in RestructureFieldDefs and RestructureIndexDefs properties.  
2.Close table.  
3.Modify RestructureFieldDefs and RestructureIndexDefs properties (add, delete or change fields and indexes descriptions)  
4.Call RestructureTable method  


  Log: String;

  {set up table component}

  ABSTable1.DatabaseName := 'emp_db'
  ABSTable1.TableName := 'employee'
  {fill in restructure properties}


  with ABSTable1 do
     {specifying new table fields}

     with RestructureFieldDefs do
     {specifying new table indexes}

     with RestructureIndexDefs do

     if (RestructureTable(Log)) then
       ShowMessage('Restructure completed'
       ShowMessage('Restructure errors: '

Note:   See also how to alter table using SQL ALTER TABLE Command.

        © 2003 - 2018 ComponentAce  | .net zip component | barcode for .net | delphi zip component | delphi database Mar 21, 2018