I'm trying to create local cube file in my program (.net C#), without MS AS, directly load data from MS SQL Server.
Exception message: “Parsing error occurred prior to ‘CREATE CUBE…..”
[code c#]
string str,strLocation, strDSN, strCreate, strInsert;
strCreate="";
strCreate+=@"CREATE CUBE Sales( ";
strCreate+=@" DIMENSION [Country], LEVEL [All] TYPE ALL, LEVEL [Country], ";
strCreate+=@" LEVEL [City], LEVEL [CustomerID], ";
strCreate+=@" DIMENSION [Salesperson], LEVEL [All] TYPE ALL, LEVEL [Salesperson],";
strCreate+=@" DIMENSION [ShipperName], LEVEL [All] TYPE ALL, LEVEL [ShipperName], ";
strCreate+=@" DIMENSION [CategoryName],LEVEL [All] TYPE ALL, LEVEL [CategoryName], ";
strCreate+=@" LEVEL [ProductName], ";
strCreate+=@" DIMENSION [OrderDate] TYPE TIME, LEVEL [All] TYPE ALL, ";
strCreate+=@" LEVEL [Year] TYPE YEAR, ";
strCreate+=@" LEVEL [Quarter] TYPE QUARTER, ";
strCreate+=@" LEVEL [Month] TYPE MONTH, ";
strCreate+=@" LEVEL [Day] TYPE DAY, ";
strCreate+=@"MEASURE [Sum Of ExtendedPrice] FUNCTION SUM, ";
strCreate+=@"MEASURE [Sum Of Quantity] FUNCTION SUM ";
strInsert="";
strInsert+=@"InsertInto=INSERT INTO Sales ";
strInsert+=@" [Country].[Country], [City], [CustomerID], ";
strInsert+=@" [Sum Of ExtendedPrice], [Sum Of Quantity], ";
strInsert+=@" [ShipperName].[ShipperName], [Salesperson].[Salesperson], ";
strInsert+=@" [CategoryName].[CategoryName], ";
strInsert+=@" [ProductName], [OrderDate]) ";
strInsert+=@"OPTIONS ATTEMPT_ANALYSIS ";
strInsert+=@"SELECT Invoices.Country, Invoices.City, Invoices.CustomerID, ";
strInsert+=@" Invoices.ExtendedPrice, Invoices.Quantity, Invoices.ShipperName, ";
strInsert+=@" Invoices.Salesperson, Categories.CategoryName, ";
strInsert+=@" Products.ProductName, Invoices.OrderDate ";
strInsert+=@"FROM Northwind.dbo.Categories Categories,";
strInsert+=@" Northwind.dbo.Invoices Invoices,";
strInsert+=@" Northwind.dbo.Products Products ";
strInsert+=@"WHERE Categories.CategoryID = Products.CategoryID ";
strInsert+=@"AND Invoices.ProductID = Products.ProductID ";
//strDSN= "SOURCE_DSN=\"DRIVER=SQL Server;SERVER=SERVER;DATABASE=Northwind\"" ;
strDSN="SOURCE_DSN=\"Provider=SQLOLEDB.1;Data Source = SERVER;Initial Catalog = Northwind\"" ;
strLocation=@"PROVIDER=MSOLAP;DATA SOURCE= E:\test1.cub";
str=strLocation+";"+strDSN+";"+strCreate+";"+strIn sert+";";
System.Data.OleDb.OleDbConnection conn=new System.Data.OleDb.OleDbConnection(str);
conn.Open();
conn.Close();
[/code]