select name from sysdatabases

解决方案 »

  1.   

    运用 Tseesion的一个方法即可:procedure GetAliasNames(List: TStrings);
    Description
    Call GetAliasNames to retrieve a list of persistent BDE aliases hose aliases that exist in persistent storage or in the BDE configuration file. List is a string list object, created and maintained by the application, into which to store the alias names.A session ConfigMode property determines whether an alias created in the context of this session is reported by GetAliasNames. If ConfigMode is cmAll, aliases created within the session are reported.例:MyStringList := TStringList.Create;try
      Session.GetAliasNames(MyStringList);
      { fill a list box with alias names for the user to select from }
      for I := 0 to MyStringList.Count - 1 do
        ListBox1.Items.Add(MyStringList[I]);
    finally
      MyStringList.Free;
    end;
      

  2.   

    use ADO connect to SQL SERVER!you all problem will resolve
      

  3.   

    use master
    select name from sysdatabases
    or ADOConnection1.GetProcedureNames();
      

  4.   

    如果不想通过连接到数据库上,再利用方法取得所有数据库的列表~!~
    我想是不用连接到数据库上,而使用SQl Server自带的函数,事件得到数据库的列表,不知道是否可以????请教!~~!~
      

  5.   

    这个问题我在前两天刚刚答过。用DTABSAE时。
    Session.GetAliasNames(lstBox1.Items);
    用ADO时:adocCon.GetTableNames(lstBox1.Items, False);