procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
SQLServer: Variant;
ServerList: Variant;
Resultvalue: boolean;
begin
Resultvalue := False;
memo1.Lines.Clear;
try
SQLServer := CreateOleObject('SQLDMO.Application');
ServerList := SQLServer.ListAvailableSQLServers;
for i := 1 to Serverlist.Count do
memo1.Lines.Add (Serverlist.item(i));
Resultvalue := True;
Finally
SQLServer := NULL;
ServerList := NULL;
end;
end;
沒有留言:
張貼留言