다음을 통해 공유


Development Environments

[!참고]

  이 기능은 다음 버전의 Microsoft SQL Server에서 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 가능한 한 빨리 수정하십시오.

You can use Decision Support Objects (DSO) with any language that supports COM Automation, such as Microsoft® Visual Basic®, Microsoft Visual Basic Scripting Edition, or Microsoft Visual C++®.

Visual Basic

You can use the DSO library in Visual Basic simply by setting the Decision Support Objects library as a project reference.

Example

Dim dsoServer As New DSO.Server
dsoServer.Connect "LocalHost"

Setting Program References

To use the DSO library in a Visual Basic application, add it as a reference to the project. On the Project menu, click References, and then select Microsoft Decision Support Objects.

Visual Basic Scripting Edition

Visual Basic Scripting Edition programmers can use DSO by using the CreateObject method. This method can be used to create any needed object in the DSO libraries.

Example

The following example creates a DSO.Server object:

Dim dsoServer
Set dsoServer = CreateObject("DSO.Server")
dsoServer.Connect "LocalHost"

In order to support scripting, the DSO Database, Cube, Partition, and Aggregation objects implement the MDStore class interface as well as their own class interface; this is the default interface used for MDStores collections of DSO objects. The following code example illustrates the retrieval of a database from a server using the MDStores collection:

Dim dsoDatabase
Set dsoDatabase = dsoServer.MDStores(1)

The ClassType and SubClassType properties of the MDStore interface allow for class determination. If the class-specific interface for a particular object is needed, first use the CreateObject command to create an instance of the object, then set it to the required object in the MDStores collection. This is demonstrated in the following code example:

Dim dsoServer
Dim dsoDatabase
Set dsoServer = CreateObject("DSO.Server")
dsoServer.Connect "LocalHost"
Set dsoDatabase = CreateObject("DSO.Database")
Set dsoDatabase = dsoServer.MDStores(1)
주의 사항주의

  It is recommended that, for any DSO object supporting the MDStore interface, the class-specific interface not be used.