次の方法で共有


AddNew (clsCollection)

ms133267.note(ja-jp,SQL.90).gifメモ :
  この機能は、Microsoft SQL Server の次のバージョンで削除されます。新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションはできるだけ早く修正してください。

The AddNew method of a Decision Support Objects (DSO) collection creates and adds an object to a collection.

構文

Set vnt = object.AddNew(Name As String, [SubClassType As SubClassTypes])

パラメータ

  • vnt
    A Variant variable that receives the instance of the new member. Instead of a variant, you can use a variable that has been declared to match the object being retrieved from the collection. For example, a variable declared as type MDStore, with its ClassType property value set to clsCube, can be used to retrieve an object from an MDStores collection of clsCube objects.
  • object
    An instance of a DSO collection object.
  • Name
    A string that specifies the name of the new object to add to the collection.
  • SubClassType
    (Optional) One of the values enumerated by the SubClassTypes enumeration. For more information, see SubClassTypes.

解説

The ClassType property of the new object is set automatically and depends on the parent of the collection to which the object is being added. For example, objects added to the MDStores collection of an object of ClassType clsDatabase automatically receive a ClassType value of clsCube.

The AddNew method maintains hierarchical relationships and ordering within the collection.

ms133267.note(ja-jp,SQL.90).gifメモ :
  The AddNew method should be used when adding new objects to a collection. You should use the Add method only when adding existing objects: for example, when you are adding aggregations to a partition after you have designed them. For more information, see clsPartitionAnalyzer.

使用例

Use the following code to create a new cube and add it to the MDStores collection of cubes:

' Assume the existence of an object objDB
' of ClassType clsDatabase. 
Dim objNewCube As MDStore 
Set objNewCube = objDB.MDStores.AddNew("NewCube") 
 

参照

関連項目

SubClassTypes

その他の技術情報

Collections

ヘルプおよび情報

SQL Server 2005 の参考資料の入手