I have a jscript that I am using to create 2 new dimensions (see below). The problem that I am encountering is "object doesn't support this action". This occurs for the following line: inventoryProductDimension.DataSource = dsoDataSource;
First is this because of jscript and secondly is there anyway around this.
Thanks
Ron
Code Snippet
var serverName = config.GetOlapServerName();
var databaseName = config.GetOlapDataBaseName();
var server = new ActiveXObject("DSO.Server");
if (server == null) throw "Could not create DSO.Server object.";
// Connect to OLAP server specified in web.config file
server.Connect(serverName);
var database = new ActiveXObject("DSO.Database");
if (database == null) throw "Could not create DSO.Database object.";
// Retrieve database object from server
database = server.MDStores(databaseName);
// Create new Dimension
var inventoryProductDimension;
//if (inventoryProductDimension == null) throw "Could not create DSO.Dimension for InventoryProduct dimension.";
// Get database's datasource
var dsoDataSource ;
dsoDataSource = database.DataSources("DataMart");
inventoryProductDimension = database.Dimensions.AddNew("InventoryProduct");
// Add inventoryproduct dimension
inventoryProductDimension.DataSource = dsoDataSource;
inventoryProductDimension.FromClause ="\"dbo\".\"InventoryProductCategory\",\"dbo\".\"InventoryProduct\"";
inventoryProductDimension.JoinClause ="(\"dbo\".\"InventoryProductCategory\".\"SurrogateKey\" = \"dbo\".\"InventoryProduct\".\"FK_InventoryProductCategory\")";
// Add InventoryProduct Levels
update: Through research, I have determined that it is not recommended that you use a scripting language to perform DSO functions because the object hierarchy is based on the MDStores interface such that if you wanted to iterate through the collection of databases on server, then you would need to iterate through MDStores rather databases. This works because each MDStore for the Server object is a database object. Bottom-line is that the language must be capable of create object types and this is not case with JScript. In my case, I opted to try another scripting language,VBScript. This seems to function properly; however the collections created using CreateObject may not be available in future versions of DSO.
Thanks
Ron Cotton
No comments:
Post a Comment