PRB: Err Msg - Duplicate Dimension Key "Product" in VBDSOCreateSmallCube Sample Application (221973)
The information in this article applies to:
- Microsoft SQL Server OLAP Services 7.0
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q221973 SYMPTOMS
When running the sample application VBDSOCreateSmallCube, you may run into the following error while it is trying to run Step 6:
Create dimension Product failed. This Key is already associated with an element of this collection.
CAUSE
This error occurs because there is already a shared dimension named "Product" in the FoodMart database.
WORKAROUND
To work around this problem, replace references to the "Product" dimension with "Products" or some other name that is not already used for an existing dimension. Replace the following line of code in the frmMain.bas module subroutine Public Sub CreateDimensionProduct():
Set dsoDimension = m_dsoDatabase.Dimensions.AddNew("Product")
with:
Set dsoDimension = m_dsoDatabase.Dimensions.AddNew("Products")
In addition, replace the following line of code in the subroutine Public Sub CreateCube():
Set dsoProductCubeDim = dsoCube.Dimensions.AddNew("Product")
with:
Set dsoProductCubeDim = dsoCube.Dimensions.AddNew("Products")
MORE INFORMATION
Also note that the functionality for Step 9 - Write Enable the Cube has been moved to the VbDSOWriteEnableCube sample.
Modification Type: | Major | Last Reviewed: | 2/24/2004 |
---|
Keywords: | kbprb KB221973 |
---|
|