Microsoft KB Archive/221973

= PRB: Err Msg - Duplicate Dimension Key "Product" in VBDSOCreateSmallCube Sample Application =

Article ID: 221973

Article Last Modified on 2/24/2004

-

APPLIES TO


 * Microsoft SQL Server OLAP Services
 * Microsoft SQL Server 2000 Standard Edition

-



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.

Keywords: kbprb KB221973

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.