Rainbow » 21.01.2004 (Ср) 16:48
Из MSDN:
1) Start a new Standard EXE project.
2) On the Project menu, click References. Select Microsoft SQLDMO Object library, and then click OK.
3) Place a CommandButton and a ListBox control on Form1.
4)Add the following code to the form's module:
Private Sub Command1_Click()
Dim i As Integer
Dim oNames As SQLDMO.NameList
Dim oSQLApp As SQLDMO.Application
Set oSQLApp = New SQLDMO.Application
Set oNames = oSQLApp.ListAvailableSQLServers()
List1.Clear
For i = 1 To oNames.Count
List1.AddItem oNames.Item(i)
Next i
End Sub