运用 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;
use ADO connect to SQL SERVER!you all problem will resolve
use master select name from sysdatabases or ADOConnection1.GetProcedureNames();
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;
select name from sysdatabases
or ADOConnection1.GetProcedureNames();
我想是不用连接到数据库上,而使用SQl Server自带的函数,事件得到数据库的列表,不知道是否可以????请教!~~!~
Session.GetAliasNames(lstBox1.Items);
用ADO时:adocCon.GetTableNames(lstBox1.Items, False);