Take the number of SQLServereb server lists.

zhaozj2021-02-16  59

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;

转载请注明原文地址:https://www.9cbs.com/read-17561.html

New Post(0)