张
张锦松
Unregistered / Unconfirmed
GUEST, unregistred user!
我用adodataset,数据来源是mdb文件,我增加一个字段后,在dbgrid上却看不到增加的字段。
procedure TForm1.Button1Click(Sender: TObject);
var ff:tfield;
begin
adodataset1.Active:=true;
ff:=Tfield.Create(adodataset1);
ff.FieldName:='name';
AdoDataSet1.Fields.Add(ff);
adodataset1.Active:=false;
adodataset1.Active:=true;
datasource2.DataSet:=adodataset1;
dbgrid2.DataSource:=datasource2;
end;
另外怎样在mdb文件里删除某字段?
procedure TForm1.Button1Click(Sender: TObject);
var ff:tfield;
begin
adodataset1.Active:=true;
ff:=Tfield.Create(adodataset1);
ff.FieldName:='name';
AdoDataSet1.Fields.Add(ff);
adodataset1.Active:=false;
adodataset1.Active:=true;
datasource2.DataSet:=adodataset1;
dbgrid2.DataSource:=datasource2;
end;
另外怎样在mdb文件里删除某字段?