Aracılığıyla paylaş


clsServer

Not

  Bu özellik Microsoft SQL Server'ın bir sonraki sürümünde kaldırılacaktır. Yeni geliştirme işlerinde bu özelliği kullanmayın ve bu özelliği kullanmakta olan uygulamaları mümkün olduğunca erken bir zamanda değiştirin.

An object of ClassType clsServer provides methods and properties that enable you to control an Analysis server.Bu ağacın kökü veritabanları, küpler ve sunucu tarafından yönetilen kullanıcı rolleri belirten karar destek nesneleri (dso) nesne modeli nesnesidir.With an object of ClassType clsServer you can:

  • Analiz Sunucu hizmet (MSSQLServerOLAPService) çalıştırıldığı bir bilgisayara bağlayın.

  • Başlatma ve durdurma sunucu.

  • Oluşturma ve çok boyutlu veri yapılarını tanımlayan nesneleri yönetme.

An object of ClassType clsServer provides collections, methods, and properties through its own internal interface.

Örnekler

A.Oluşturma ve Sunucu başlatılıyor

Oluşturmak ve bir sunucuyu başlatmak için şu kodu kullanın.Kullanabileceğiniz LocalHost çalıştıran aynı bilgisayarda çözümleme sunucusu belirtmek içinsizin dso uygulama.

'Create instance of server and connect
Public dsoServer As DSO.Server
Set dsoServer = New DSO.Server
'ServerName is the Windows NT 4.0 Server or Windows 2000 Server computer 
'where the Analysis service is loaded and running.
'An error is raised if the connection attempt fails
dsoServer.Connect "ServerName"

Bu örnek aynı sonucu gerçekleştirir:

DsoServer = New DSO.Server
dsoServer.Name = "ServerName"
dsoServer.Connect

B.Oluşturma ve bir sunucuya bağlanma

The following example shows how to create an instance of a DSO object of ClassType clsServer and connect to an Analysis server:

Public Sub ConnectToServer()
    Dim dsoServer As DSO.Server
    
    On Error GoTo ErrHandler
    
    ' Initialize server.
    Set dsoServer = New DSO.Server
    
    ' Connect to the local Analysis server.
    ' If a connection cannot be made, an error is raised.
    dsoServer.Connect "LocalHost"
    
    ' Print server properties to the Debug window.
    With dsoServer
        Debug.Print "Server Properties --------------------------"
        Debug.Print "Name:            " & .Name
        Debug.Print "Description:     " & .Description
        Debug.Print "ConnectTimeout:  " & .ConnectTimeout
        Debug.Print "LockTimeout:     " & .LockTimeout
        Debug.Print "Version:         " & .Version
    End With
    
    ' Close connection to server.
    dsoServer.CloseServer

ExitRoutine:
    Set dsoServer = Nothing
    Exit Sub
    
ErrHandler:
    Debug.Print "Error connecting to server:"
    Debug.Print Err.Number, Err.Description, Err.Source
End Sub