Function TFORM3.INITFRM: Boolean; Begin getSqlserverList (listbox1); result: = true;
Function getSqlserverList (var list: tlistbox): boolean; // gets the number of SQLServereb server lists. var i: integer; SQLServer: Variant; ServerList: Variant; begin Result: = False; List.Clear; try SQLServer: = CreateOleObject ( 'SQLDMO.Application'); ServerList: = SQLServer.ListAvailableSQLServers; for i: = 1 to Serverlist .Count do list.items.add (serverList.Item (i)); result: = true; finally sqlserver: = null; serverlist: = null; end;