The Depth property of the Level object always returns -1 (824304)
The information in this article applies to:
- Microsoft Data Access Components 2.7
- Microsoft Data Access Components 2.8
WebData:103869 SYMPTOMSThe Depth property of an instance of the Level object always returns
-1 instead of the actual depth level. CAUSEThis problem occurs because the code that maps Microsoft SQL Server 2000 Analysis Services internal data types into VARIANT subtypes has changed. The VARIANT subtype that is assigned to the value that represents the depth level has changed. Because the GetSchemaObject method does not support the new subtype for the Depth property, GetSchemaObject ignores the new value and leaves the default value of -1. This value is assigned by the constructor of the Level object.WORKAROUNDTo work around this problem and obtain the actual depth level, use the
LevelDepth property of the first member of the Level object. To do so, use the following code: Dim oLevel As ADOMD.Level
Dim oMember As ADOMD.Member
Dim oCellset As ADOMD.Cellset
Dim lMembLvDepth As Long
Dim lLevelDepth As Long
Dim oCube As ADOMD.CubeDef
Set oCatalog = New ADOMD.Catalog
oCatalog.ActiveConnection = "Provider=MSOLAP;Data Source=localhost;Initial Catalog=Foodmart 2000"
Set oCube = oCatalog.CubeDefs("Warehouse")
Set oLevel = oCube.GetSchemaObject(adObjectTypeLevel, "[Store].[Store Name]")
Debug.Print oLevel.Members(0).LevelDepth 'This is the suggested workaroundSTATUSMicrosoft is aware of this problem. This problem might be fixed in a future version of the products in the "Applies to" section.
| Modification Type: | Major | Last Reviewed: | 12/9/2003 |
|---|
| Keywords: | kbprb KB824304 kbAudDeveloper |
|---|
|