我想在载入一张表以后给它添加上另外的一列,这样写对不对?
procedure TForm1.Button2Click(Sender: TObject);
begin
table1.Active:=false;
if opendialog1.Execute then begin
caption:=Opendialog1.FileName;
table1.TableName:=Opendialog1.FileName;
table1.FieldDefs.Add('Choosen',ftString,1,false);
Filename:=OpenDialog1.Filename;
table1.Active:=true;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
table1.Active:=false;
if opendialog1.Execute then begin
caption:=Opendialog1.FileName;
table1.TableName:=Opendialog1.FileName;
table1.FieldDefs.Add('Choosen',ftString,1,false);
Filename:=OpenDialog1.Filename;
table1.Active:=true;
end;
end;
看看这个http://expert.csdn.net/Expert/topic/2205/2205217.xml?temp=.4727442