FIX: "Invalid Pointer" Error When Creating Calculated Member in a Local Cube
This article was previously published under Q241356
You receive the following error when attempting to create a local cube with a calculated member by using the COMMAND clause:
Error# -2147467261 Invalid Pointer.
The current version of OLAP Services doesn't support this functionality for a local cube.
Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 2.0 for Microsoft SQL Server 7.0. For information about how to download and install the latest SQL Server Service Pack, see the following Microsoft Web site:
The product documentation for OLAP Services incorrectly states that you can create calculated members that persist with the local cube. Following is the incorrect documentation:
A calculated member can be persisted in a local cube if a CREATE MEMBER statement is specified in the COMMAND clause of the CREATE CUBE statement.The COMMAND clause in the above code is not supported for a local cube, and causes the error shown in the "Summary" section if it is included in the CREATE CUBE statement.
CREATE CUBE MYWAREHOUSE (DIMENSION . . .. . . ,COMMAND [CREATE MEMBER [MYWAREHOUSE].[MEASURES].[WAREHOUSEPROFIT] AS '[MEASURES].[WAREHOUSE SALES] - [MEASURES].[WAREHOUSE COST]'])
Steps to Reproduce the ErrorA group of samples ship on the SQL 7.0 CD in the MSolap/Samples directory. Run the compressed file called Samples.exe to extract the samples. In that group of samples there is a Visual Basic project named VBADOCREATECUBE that shows how to create a local cube through ADO.
To reproduce the error, modify the following lines in the Visual Basic VBADOCREATECUBE sample:
Remove the closed parenthesis [)] from the first line and uncomment the next three lines so that the code resembles the following:
strCreateCube = strCreateCube & "Format '#.#')"'strCreateCube = strCreateCube & ","'strCreateCube = strCreateCube &" COMMAND [CREATE MEMBER [MEASURE].[Warehouse Profit] "'strCreateCube = strCreateCube &"AS '[MEASURE].[Warehouse Sales] - [MEASURE].[Warehouse Cost]'])"
strCreateCube = strCreateCube & "Format '#.#'"strCreateCube = strCreateCube & ","strCreateCube = strCreateCube &" COMMAND [CREATE MEMBER [MEASURE].[Warehouse Profit] "strCreateCube = strCreateCube &"AS '[MEASURE].[Warehouse Sales] - [MEASURE].[Warehouse Cost]'])"
Article ID: 241356 - Last Review: 07/19/2006 09:20:52 - Revision: 5.1
Microsoft SQL Server 7.0 Standard Edition, Microsoft OLE DB Provider for OLAP Services 7.0
- kbbug kbdatabase kbfix KB241356