在delphi中Import type library,生成Adox_tlb.pas,引用它
procedure TForm1.Button2Click(Sender: TObject);
var i,j,k:integer;
var cat:_Catalog;
begin
cat:=coCatalog.Create;
cat.Set_ActiveConnection(self.ADOConnection1.ConnectionObject);
for i:=0 to cat.Tables.Count-1 do
if cat.Tables.Item.Name = 'test' then //找到你要改的表
for j:=0 to cat.Tables.Item.Columns.Count-1 do
if cat.Tables.Item.Columns.Item[j].Name = 't3' then //找到你要改的列
for k:=0 to cat.Tables.Item.Columns.Item[j].Properties.count-1 do
if Lowercase(cat.Tables.Item.Columns.Item[j].Properties.Item[k].name)='description' then
cat.Tables.Item.Columns.Item[j].Properties.Item[k].Value:='test'; //把这个字段的描述改成'test'
end;
修改表的描述还未找到办法