ValidateStructure (clsMiningModel)

Analysis Services Programming

Analysis Services Programming

ValidateStructure (clsMiningModel)

The ValidateStructure method of an object of ClassType clsMiningModel validates the structure of the object, raising an error if an invalid structure element is encountered.

Syntax

object.ValidateStructure

object

The mining model object whose structure is to be validated.

Remarks

The ValidateStructure method ensures that the following requirements are met for all data mining models:

  • The MiningAlgorithm property contains the name of a valid data mining algorithm.

  • At least one column exists in the Columns collection. A column is an object with a ClassType of clsColumn.

  • At least one column in the Columns collection must be enabled.

  • All columns in the Columns collection must be valid.

For clsMiningModel objects with a SubClassType of sbclsRelational, the following additional requirement must be met:

  • The FromClause property must not be empty.

For clsMiningModel objects with a SubClassType of sbclsOlap, the following additional requirements must be met:

  • The SourceCube property must contain the name of a valid cube in the same database as the OLAP mining model.

  • The cube named in the SourceCube property must be visible and cannot contain data mining dimensions.

  • The CaseDimension property must contain the name of a valid dimension in the same database as the OLAP mining model.

  • The dimension named in the CaseDimension property must be visible and cannot be a virtual dimension created by an earlier version of Microsoft® SQL Server™ 2000 Analysis Services.
Example

The following example validates the OLAP data mining model Customer Pattern Discovery:

' Assume an object (dsoDB) of ClassType clsDatabase exists.
   Dim dsoDMM As DSO.MiningModel
   Set dsoDMM = dsoDB.MiningModels("Customer Pattern Discovery")

' Validate the data mining model.
   On Error Resume Next
   dsoDMM.ValidateStructure
   If Err.Number <> 0 Then MsgBox "An error occurred while" & _
      " validating the mining model:" & vbCrLf & _
      Err.Description

See Also

clsMiningModel