Board index » delphi » SQL Server Enumeration (how get a list of servers)

SQL Server Enumeration (how get a list of servers)

Hi.

How i can get a list of avialable SQL Servers (like editor of ADO
Connection)?

Thank you
Alexey Matveev

 

Re:SQL Server Enumeration (how get a list of servers)


Quote

>How i can get a list of avialable SQL Servers (like editor of ADO
>Connection)?

try this

var
  dmo, servers: OleVariant;
  i: Integer;
begin
  dmo := CreateOleObject('SQLDMO.Application');
  servers := dmo.ListAvailableSQlServers;
  for i := 1 to servers.Count  do
    yourStringList.Add(servers.Item(i));
  servers := UnAssigned;
  dmo := UnAssigned;
end;

http://www.delphi32.co.yu/preuzeti_tekstovi/exploiting_sql_server_1.htm

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads