tags:

views:

443

answers:

2

I have a problem with creating an offline OLAP cube from C# using following code:

using (var connection = new OleDbConnection())
    {
       connection.ConnectionString = "Provider=MSOLAP;  Initial Catalog=[OCWCube];  Data Source=C:\\temp\\test.cub;  CreateCube=CREATE CUBE [OCWCube] (   DIMENSION [NAME],    LEVEL [Wszystkie] TYPE ALL,    LEVEL [NAME],   MEASURE [Liczba   DESCRIPTIO]    FUNCTION COUNT  );  InsertInto=INSERT INTO OCWCube([Liczba   DESCRIPTIO], [NAME].[NAME])  OPTIONS ATTEMPT_ANALYSIS  SELECT Planners.DESCRIPTIO, Planners.NAME  FROM Planners Planners;  Source_DSN=\"CollatingSequence=ASCII;DefaultDir=c:\\temp;Deleted=1;Driver={Microsoft dBase Driver (*.dbf)};DriverId=277;FIL=dBase IV;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=600;SafeTransactions=0;Statistics=0;Threads=3;UserCommitSync=Yes;\";Mode=Write;UseExistingFile=True";
        try
        {
            connection.Open();
        }
        catch (OleDbException e)
        {
            Console.WriteLine(e);
        }
    }

I keep on getting the following exception:

"Multiple-step operation generated errors. Check each OLE database status value. No action was taken."

I took the connection string literally from OQY file generated by Excel. I had to add "Mode=Write" section, otherwise I was getting another exception ("file may be in use").

What is wrong with the connection string? How to diagnose the error? Somebody please guide me...

A: 

Hello, I have the same problem, did you find a solution?

Thank you

Giovanni
A: 

This time Microsoft Support found a workung solution for me! It is very simple - the last part of the connection string should look like this:

"Source_DSN=dbfodbc32; Mode=ReadWrite; UseExistingFile=False"

The most critical part is "Mode=ReadWrite; UseExistingFile=False".

After this modification cube was created properly. Hope this helps.

jimmyjoe