ado的gettablename()为什么把所有用户的表都取出来了!我想根据连接属性里的用户名,把用户的表取出来!怎么取呀!在线等待,立即结帐!

解决方案 »

  1.   

    你用的ADO的TABLE还是QUERY
    ADO还是和TABLE或QUERY一样的使用
    也是和DATABASE连接的!
      

  2.   

    我想用SQL语句从系统表里取,怎么写?
      

  3.   

    var co:tadoconnection;
    begin
    //取得当前的表名
    if connectstring.Text='' then exit;
      co:=tadoconnection.Create(self);
      co.LoginPrompt:=false;
      co.ConnectionString :=connectstring.Text;
      co.Open;
      co.GetTableNames(tablelist.Items);
      co.Close;
      co.free;
    end;
      

  4.   

    var 
      co:tadoconnection;
      tablelist:tstringlist;  
    begin
    //取得当前的表名
    tableblist:=Tstringlist.create;
    if connectstring.Text='' then exit;
      co:=tadoconnection.Create(self);
      co.LoginPrompt:=false;
      co.ConnectionString :=connectstring.Text;
      co.Open;
      co.GetTableNames(tablelist);
      co.Close;
      co.free;
    end;