Creation of local cubes via properties fails ... 
Author Message
 Creation of local cubes via properties fails ...

Hello,

I would like to create local cubes by setting the PivotTable Service
properties:

DBPROP_MSMD_SOURCE_DSN
DBPROP_MSMD_CREATECUBE
DBPROP_MSMD_INSERTINTO

but somehow I always recieve the error code -2147467259 (Unspecified
error) - it might
be that I made an error in initializing the data source or something is
wrong with the strings
I used for the properties. I appended the fragment of my code which creates
a local cube
via the connection string without any problems but fails when I try to
create the same local
cube via setting the properties:

Thanks for any hints to get rid of this problem
Thomas

USES_CONVERSION;
HRESULT hr1;
CDataSource ds1;
CString sConnectString;

// set the connection string
sConnectString = "PROVIDER=MSOLAP;DATA
SOURCE=E:\\LocalCube1.cub;SOURCE_DSN=FoodMart 2000;CREATECUBE=CREATE CUBE
Sample( DIMENSION [Store], LEVEL [All Stores] TYPE ALL, LEVEL [Store
Country],DIMENSION [Time] TYPE TIME, LEVEL [All Time]  TYPE ALL, LEVEL
[Year]  TYPE YEAR, LEVEL [Quarter]  TYPE QUARTER,MEASURE [Units Ordered]
Function Sum );INSERTINTO=INSERT INTO Sample ( Store.[Store Country], Time,
Measures.[Units Ordered] )SELECT store.store_country AS
Col1,time_by_day.the_date AS Col2,inventory_fact_1997.units_ordered AS Col3
From [inventory_fact_1997], [product], [product_class], [time_by_day],
[store], [warehouse] Where [inventory_fact_1997].[product_id] =
[product].[product_id] And [product].[product_class_id] =
[product_class].[product_class_id] And [inventory_fact_1997].[time_id] =
[time_by_day].[time_id] And [inventory_fact_1997].[store_id] =
[store].[store_id] And [inventory_fact_1997].[warehouse_id] =
[warehouse].[warehouse_id];";

// OpenFromInitializationString(...) creates the local cube in the expected
way
hr1 = ds1.OpenFromInitializationString(T2OLE(sConnectString));
TRACE("OpenFromInitializationString: %i\n",hr1);
ds1.Close();

// create a property set to set the properties required to create a local
cube
CDBPropSet propSetOlap(DBPROPSET_MSOLAPINIT);

// set the string used for the property DBPROP_MSMD_SOURCE_DSN
CString strConnectionString;
strConnectionString =
"PROVIDER=MSOLAP,LOCATION=E:\\LocalCube2.cub,SOURCE_DSN=\"DATA
SOURCE=LocalHost;PROVIDER=MSOLAP;INITIAL CATALOG=FoodMart 2000\"";//
strProvider + strLocation + strSourceDSN;
propSetOlap.AddProperty(DBPROP_MSMD_SOURCE_DSN, strConnectionString);

// set the string used for the property DBPROP_MSMD_CREATECUBE
CString strCreateCube;
strCreateCube = "CREATE CUBE Sample( DIMENSION [Store], LEVEL [All Stores]
TYPE ALL, LEVEL [Store Country],DIMENSION [Time] TYPE TIME, LEVEL [All Time]
TYPE ALL, LEVEL [Year]  TYPE YEAR, LEVEL [Quarter]  TYPE QUARTER,MEASURE
[Units Ordered] Function Sum )";
propSetOlap.AddProperty(DBPROP_MSMD_CREATECUBE, strCreateCube);

// set the string used for the property DBPROP_MSMD_INSERTINTO
CString strInsertInto;
strInsertInto = "INSERT INTO Sample ( Store.[Store Country], Time,
Measures.[Units Ordered] )SELECT store.store_country AS
Col1,time_by_day.the_date AS Col2,inventory_fact_1997.units_ordered AS Col3
From [inventory_fact_1997], [product], [product_class], [time_by_day],
[store], [warehouse] Where [inventory_fact_1997].[product_id] =
[product].[product_id] And [product].[product_class_id] =
[product_class].[product_class_id] And [inventory_fact_1997].[time_id] =
[time_by_day].[time_id] And [inventory_fact_1997].[store_id] =
[store].[store_id] And [inventory_fact_1997].[warehouse_id] =
[warehouse].[warehouse_id]";
propSetOlap.AddProperty(DBPROP_MSMD_INSERTINTO, strInsertInto);

HRESULT hr2;
CDataSource ds2;
// Open(...) causes an error code -2147467259
hr2 = ds2.Open(CLSID_MSOLAP,&propSetOlap);
TRACE("Open: %i\n",hr2);
ds2.Close();



Sat, 23 Aug 2003 01:03:48 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. Local cube from local cube

2. Problem: Define Custom member on local cube creation (Not measures dimension)

3. Custom member properties in a local cube

4. Creating a member property for a local cube.

5. Problem with member properties in local cube

6. Member properties in local cube for Analysis Services?

7. Member Properties in Local Cubes

8. Member Properties in Local Cubes

9. Member properties in local cubes

10. Local Cube - Member Property

11. How to connect to Local Cubes VIA HTTP ?

12. Alternative Regular Cube creation besides Cube wizard/Editor method


 
Powered by phpBB® Forum Software