你用一公用table1与一公用tdatasource就行了,用如下过程实现;
procedure opentable(tablename:string);
var
table1:ttable;
begin
try
table1:=ttable.create(application);
table1.datasource:={此为公用tdatasource名};
table1.tablename:=tablename;
table1.active:=true;
finally
table1.free;
end;
end;
procedure opentable(tablename:string);
var
table1:ttable;
begin
try
table1:=ttable.create(application);
table1.datasource:={此为公用tdatasource名};
table1.tablename:=tablename;
table1.active:=true;
finally
table1.free;
end;
end;
table1.tablename:=表名;