Working with Servers
[!참고]
이 기능은 다음 버전의 Microsoft SQL Server에서 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 가능한 한 빨리 수정하십시오.
The example code in this topic shows you how to connect to an Analysis server using Decision Support Objects (DSO) and list some of its property values.
If the Analysis server is not installed on the computer on which you are running this example, change LocalHost to the name of the Microsoft® Windows NT® Server 4.0 or Windows® 2000 computer where the Analysis server is installed and running.
List Servers
The following code example illustrates the use of the DSO.Server object in connecting to and retrieving attributes from an Analysis server. The following code example connects to the local Analysis server using the Connect method of the DSO.Server object, and then it displays some of the basic server properties in the Immediate window:
Private Sub ListServerProps()
Dim dsoServer As DSO.Server
Dim enuClassType As DSO.ClassTypes
' Create instance of server and connect.
' "LocalHost" will default to the
' local Windows NT Server 4.0 where the
' Analysis server is installed.
Set dsoServer = New DSO.Server
dsoServer.Connect "LocalHost"
' Show the server's information to the user.
If dsoServer.ClassType = clsServer Then
Debug.Print "Server Properties:"
Debug.Print " Name: " & dsoServer.Name
Debug.Print "Description: " & dsoServer.Description
End If
End Sub