这是一个程序中修改表的结构的段落,请参考。
这还是我两年前写的玩意。
//临时库的产生
with Table1 do begin
TableName:='db_temp.db';
if Table1.Exists then begin
Table1.Active:=False;
Table1.DeleteTable;
end;
with FieldDefs do begin
clear;
with AddFieldDef do begin
Name:='CL_ID';
DataType:=ftString;
Size:=5;
end;
with AddFieldDef do begin
Name:='CL_name';
DataType:=ftString;
Size:=18;
end;
with AddFieldDef do begin
Name:='CL_gg';
DataType:=ftString;
Size:=18;
end;
with AddFieldDef do begin
Name:='CL_dw';
DataType:=ftString;
Size:=4;
end;
with AddFieldDef do begin
Name:='CL_dj';
DataType:=ftFloat;
end;
with AddFieldDef do begin
Name:='CL_sn';
DataType:=ftFloat;
end;
with AddFieldDef do begin
Name:='CL_je';
DataType:=ftFloat;
end;
end;
CreateTable;
Active:=True;
end;