alter table aaaa add ddd char(20)

解决方案 »

  1.   

    alter table tableName add NewField int
      

  2.   

    再问一下如何动态实现ADOTable的字段编辑中 New Field 的功能?
      

  3.   

    这样的话,你可以在程序的运行过程中动态的创建table和其中的字段,那么,动态的字段的创建也包括在下面着段程序中。 if not Table1.Exists then begin
      with Table1 do begin
        { The Table component must not be active }
        Active := False;  
        { First, describe the type of table and give }
        { it a name }
        DatabaseName := 'DBDEMOS';
        TableType := ttParadox;
        TableName := 'CustInfo';
        { Next, 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;
        { Next, describe any indexes }
        with IndexDefs do begin
          Clear;
          { The 1st index has no name because it is
          { a Paradox primary key }
          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;