delphi获取库中所有表名,表字段名

来源:互联网 发布:域名自助管理 编辑:程序博客网 时间:2024/05/22 14:18
var  
      ts:Tstrings;  
      i:integer;  
  begin  
      ts:=Tstringlist.Create;  
      //adoconnection1.GetTableNames(ts,false);  
      //for   i:=0   to   ts.Count-1   do  
      //   showmessage('第'+inttostr(i+1)+'个表名是'+ts.Strings);  
      adoconnection1.GetFieldNames('stu',ts);  
      for   i:=0   to   ts.Count-1   do  
              showmessage('第'+inttostr(i+1)+'个字段名是'+ts.Strings);  
  end;  
    //注:用session控件也可以完成以上的功能