I'm accesing a MySQL database.
If I only have access to the .NET data provider for mysql called
ByteFX.MySqlClient and not to the ODBC Provider
Can I create the cube file with just the
ByteFX.MySqlClient.Connection object
or
SqlConnection.Connection.
I think the answer could apply for both
Another question.
I'd tried to use OLEDB ODBC DSN less connection.
A simple connection looks something like this:
ADODB.Connection con = new ADODB.Connection();
con.ConnectionString = "Provider=MSDASQL.1;Extended
Properties=\"DRIVER={MySQL ODBC 3.51
Driver};SERVER=127.0.0.1;PORT=;OPTION=3;DATABASE=database;USER=root\""
and it works to connect.
But I'm trying to use this ConnectionString in the creation of a Local
Cube:
string sConnection=null;
string sLocation=null;
string sSourceDSN=null;
string sCreateCube=null;
string sInsertInto=null;
ADODB.Connection adocon = new ADODB.Connection();
sLocation = @"LOCATION= c:\cubes\cube.cub";
//Here is where I want to use the previous DSN Less connection
sSourceDSN = "SOURCE_DSN=\"Provider=MSDASQL.1;Extended
Properties=\"DRIVER={MySQL ODBC 3.51
Driver};SERVER=127.0.0.1;PORT=3306;OPTION=3;DATABASE=database;USER=root\"\"";
//This is using a ODBC DSN that I don't want
//unless it can be created programatically
//sSourceDSN = "SOURCE_DSN=myCubeDBTarget";
sCreateCube = @"
CREATECUBE=CREATE CUBE cubetest
(
DIMENSION[Place],
LEVEL[ALL Place] TYPE ALL,
LEVEL[Country],
LEVEL[City],
DIMENSION[Product],
LEVEL[All Product] TYPE ALL,
LEVEL[Category],
LEVEL[Name],
MEASURE[Quantity] FUNCTION SUM Format '#,#'
)
";
sInsertInto = @"
INSERTINTO=INSERT INTO cubetest
(
Lugar.[Country],
Lugar.[City],
Producto.[Category],
Producto.[Name],
Measures.[Quantity]
)";
sInsertInto += @"
SELECT
c.Country,
c.City,
c.Category,
c.Product,
c.Quantity
FROM
cubetest c
";
sConnection = sLocation + ";" + "\n" + sSourceDSN + ";" + "\n" +
sCreateCube + ";" + "\n" + sInsertInto;
adocon.ConnectionString = sConnection;
adocon.Provider = "MSOLAP";
adocon.Open(sConnection,"","",0);
Well I hope someone could clear this 2 questions.