List of available SQL SERVER database servers

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
RichTat
Posts: 16
Joined: Tue 04 Mar 2008 17:10
Location: UK

List of available SQL SERVER database servers

Post by RichTat » Thu 04 Nov 2010 17:25

The TUniConnection.SpecificOptions dialog Connect tab includes a SERVER combobox containing a list of all currently available/detected SQL SERVER database servers.
How do I get this server list at run-time so that the user can select a server to make a connection ?

AndreyZ

Post by AndreyZ » Fri 05 Nov 2010 07:38

Hello,

You can use the GetServerList global function from the Uni unit in the following way:

Code: Select all

  str := TStringList.Create;
  try
    GetServerList('SQL Server', str);
    // your code
  finally
    str.Free;
  end;

RichTat
Posts: 16
Joined: Tue 04 Mar 2008 17:10
Location: UK

Post by RichTat » Sat 06 Nov 2010 12:54

Hello

Yes thank you that works.
However, I cannot find a reference to this function anywhere in the HELP screens - I looked for something before I asked the question.

AndreyZ

Post by AndreyZ » Mon 08 Nov 2010 12:52

This function is undocumented.

Post Reply