CreateObject

The CreateObject method of an object of ClassType clsServer creates an object.

Syntax

objServer.CreateObject(ClassType, [SubClassType])

objServer
An object of ClassType clsServer.
ClassType
The class type of the object to be created. A member of the ClassTypes enumeration.
SubClassType
Optional. The subclass type of the object to be created. A member of the SubClassTypes enumeration. Default is sbclsRegular.
Remarks

When you are using DSO to construct major objects such as cubes, partitions, dimensions, and so forth, it is more convenient to use the AddNew method instead. The AddNew method creates an object of the appropriate ClassType in a collection and initializes its Name and Parent properties.

You can use the “LocalHost” to specify the OLAP server running on the same computer as your DSO application.

Example

' Assume objServer is a server object and objDB is a database object

Dim objCube as New DSO.MDStore

Set objCube = objServer.CreateObject("clsCube")

objCube.Name = "NewCube"

objDB.MDStores.Add objCube

 

(c) 1988-1998 Microsoft Corporation. All Rights Reserved.