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

ID: Q221973


The information in this article applies to:


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.

Additional query words:


Keywords          : SSrvProg SSOSsampapp 
Version           : winnt:7.0
Platform          : winnt 
Issue type        : kbprb 

Last Reviewed: March 31, 1999