dbTalk Databases Forums  

UPDATE CUBE error using ADO or OleDB

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss UPDATE CUBE error using ADO or OleDB in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Vinicius Bellino
 
Posts: n/a

Default UPDATE CUBE error using ADO or OleDB - 05-07-2004 , 06:08 PM






Hello,

I´m doing a ASP.NET page (vb.net) and trying to Writeback a value in a
Cube through the UPDATE CUBE Statement.

Just to test I'm using the Bugdet Cube of FoodMart 2000, which I
changed to allow Write Back. Using the MDX Application Sample I could
execute the following commands without any problem:

UPDATE CUBE [Budget]
SET ([Account].[Lease],[Store].[Store 20],
[Category].[Forecast],[Time].[1],[Measures].[Amount]) = 10

and after that one line was inserted in the Writeback table.

But if I execute the same statement in the ASP.NET I get an error
message saying that the Cube is read-only and the UPDATE couldn't be
processed.

These are my codes, first using ADODB:

'Code using ADODB
Dim conAS As New ADODB.Connection
Dim MDXset As String

conAS.Mode() = ConnectModeEnum.adModeReadWrite
conAS.ConnectionString() = "provider=MSOLAP;Data Source=
localhost;Initial Catalog=FoodMart 2000"
conAS.CommandTimeout() = 300000
conAS.Open()

'A simple CUBE UPDATE just in leaf member of all dimensions that works
fine in the MDX Sample Application

MDXset = "UPDATE CUBE [Budget] SET ([Account].[Lease],[Store].[Store
20],[Category].[Forecast],[Time].[1],[Measures].[Amount]) = 10"

conAS.BeginTrans()
conAS.Execute(MDXset)
conAS.CommitTrans()
conAS.Close()

When I get the following error message:
"The operation has failed because of an attempt to update a read-only
object"

And second an alternative code using OleDB:
'Code using OleDB
Dim MDXSet As String
Dim mConn = New OleDbConnection("provider=MSOLAP;Data
Source=LocalHost;Initial Catalog=FoodMart 2000")
Dim Command As OleDbCommand
Dim mTrans As OleDbTransaction

'A simple CUBE UPDATE just in leaf member of all dimensions that works
fine in the MDX Sample Application
MDXSet = "UPDATE CUBE [Budget] SET ([Account].[Lease],[Store].[Store
20],[Category].[Forecast],[Time].[1],[Measures].[Amount]) = 10"

mConn.Open()

mTrans = mConn.BeginTransaction()
Command = New OleDbCommand
Command.Connection() = mConn
Command.CommandText() = MDXSet
Command.Transaction() = mTrans
Command.ExecuteNonQuery()
mTrans.Commit()

Getting the error message:
"Updates cannot be propagated to cube 'Budget' because it is a
read-only cube. The operation has failed because of an attempt to
update a read-only object"

I also tried to use this ConnectionString:

"provider=MSOLAP;Data Source=localhost;Initial Catalog=FoodMart 2000;"
& _
"Writeback Timeout=300;Cache Ratio=0.1;Cache Ratio2=0.1;Default
Isolation Mode=0;Execution Location=3;Client Cache Size=0;Secured Cell
Value=3;"

But even so the error persists!

Does anybody can help me??

I really have no idea what else I could try about it!

Reply With Quote
  #2  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: UPDATE CUBE error using ADO or OleDB - 05-13-2004 , 01:23 AM






Could it be related to security ? What are the credentionals under which you
connect to AS from the ASP.NET page ?

--
==================================================
Mosha Pasumansky - http://www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================

"Vinicius Bellino" <vbellino (AT) uol (DOT) com.br> wrote

Quote:
Hello,

I´m doing a ASP.NET page (vb.net) and trying to Writeback a value in a
Cube through the UPDATE CUBE Statement.

Just to test I'm using the Bugdet Cube of FoodMart 2000, which I
changed to allow Write Back. Using the MDX Application Sample I could
execute the following commands without any problem:

UPDATE CUBE [Budget]
SET ([Account].[Lease],[Store].[Store 20],
[Category].[Forecast],[Time].[1],[Measures].[Amount]) = 10

and after that one line was inserted in the Writeback table.

But if I execute the same statement in the ASP.NET I get an error
message saying that the Cube is read-only and the UPDATE couldn't be
processed.

These are my codes, first using ADODB:

'Code using ADODB
Dim conAS As New ADODB.Connection
Dim MDXset As String

conAS.Mode() = ConnectModeEnum.adModeReadWrite
conAS.ConnectionString() = "provider=MSOLAP;Data Source=
localhost;Initial Catalog=FoodMart 2000"
conAS.CommandTimeout() = 300000
conAS.Open()

'A simple CUBE UPDATE just in leaf member of all dimensions that works
fine in the MDX Sample Application

MDXset = "UPDATE CUBE [Budget] SET ([Account].[Lease],[Store].[Store
20],[Category].[Forecast],[Time].[1],[Measures].[Amount]) = 10"

conAS.BeginTrans()
conAS.Execute(MDXset)
conAS.CommitTrans()
conAS.Close()

When I get the following error message:
"The operation has failed because of an attempt to update a read-only
object"

And second an alternative code using OleDB:
'Code using OleDB
Dim MDXSet As String
Dim mConn = New OleDbConnection("provider=MSOLAP;Data
Source=LocalHost;Initial Catalog=FoodMart 2000")
Dim Command As OleDbCommand
Dim mTrans As OleDbTransaction

'A simple CUBE UPDATE just in leaf member of all dimensions that works
fine in the MDX Sample Application
MDXSet = "UPDATE CUBE [Budget] SET ([Account].[Lease],[Store].[Store
20],[Category].[Forecast],[Time].[1],[Measures].[Amount]) = 10"

mConn.Open()

mTrans = mConn.BeginTransaction()
Command = New OleDbCommand
Command.Connection() = mConn
Command.CommandText() = MDXSet
Command.Transaction() = mTrans
Command.ExecuteNonQuery()
mTrans.Commit()

Getting the error message:
"Updates cannot be propagated to cube 'Budget' because it is a
read-only cube. The operation has failed because of an attempt to
update a read-only object"

I also tried to use this ConnectionString:

"provider=MSOLAP;Data Source=localhost;Initial Catalog=FoodMart 2000;"
& _
"Writeback Timeout=300;Cache Ratio=0.1;Cache Ratio2=0.1;Default
Isolation Mode=0;Execution Location=3;Client Cache Size=0;Secured Cell
Value=3;"

But even so the error persists!

Does anybody can help me??

I really have no idea what else I could try about it!



Reply With Quote
  #3  
Old   
Vinicius Bellino
 
Posts: n/a

Default Re: UPDATE CUBE error using ADO or OleDB - 05-13-2004 , 07:44 AM



Hello,

Yes, it was related with security, because the IIS was configured to
accept "anonymous user", so the "anonynous user" didn't have
permissions to update the cube. But the point is, after I change the
configuration of IIS, I could execute the UPDATE CUBE throught an old
ASP page, using ADO without put the user_name and password in the
connection string. But when I tried to do the same throught my ASP.NET
webpage, it still couldn't update the cube, debbuging the ASP.NET I
verified that the current user was the same of the one acessing the
old ASP page, in both cases I used Windows Integrated Security and the
current user logged is OLAP Admin. Well, to solve the problem I
changed the "Cell Security policy" to Unrestricted Read/Write, before
it was just Unrestricted Read. But I'm not felling confortable with
the solution, because I don't know why, using Unrestricted Read, I
could update the cube via old ASP and not via ASP.NET, if I use the
same object to connect the AS (ADO), the same query string and the
same user who is OLAP Admin. Do you have any idea about it?

Thanks,

Vinicius Bellino

"Mosha Pasumansky [MS]" <moshap (AT) online (DOT) microsoft.com> wrote

Quote:
Could it be related to security ? What are the credentionals under which you
connect to AS from the ASP.NET page ?

--
==================================================
Mosha Pasumansky - http://www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================

"Vinicius Bellino" <vbellino (AT) uol (DOT) com.br> wrote in message
news:93d12908.0405071508.1e519105 (AT) posting (DOT) google.com...
Hello,

I´m doing a ASP.NET page (vb.net) and trying to Writeback a value in a
Cube through the UPDATE CUBE Statement.

Just to test I'm using the Bugdet Cube of FoodMart 2000, which I
changed to allow Write Back. Using the MDX Application Sample I could
execute the following commands without any problem:

UPDATE CUBE [Budget]
SET ([Account].[Lease],[Store].[Store 20],
[Category].[Forecast],[Time].[1],[Measures].[Amount]) = 10

and after that one line was inserted in the Writeback table.

But if I execute the same statement in the ASP.NET I get an error
message saying that the Cube is read-only and the UPDATE couldn't be
processed.

These are my codes, first using ADODB:

'Code using ADODB
Dim conAS As New ADODB.Connection
Dim MDXset As String

conAS.Mode() = ConnectModeEnum.adModeReadWrite
conAS.ConnectionString() = "provider=MSOLAP;Data Source=
localhost;Initial Catalog=FoodMart 2000"
conAS.CommandTimeout() = 300000
conAS.Open()

'A simple CUBE UPDATE just in leaf member of all dimensions that works
fine in the MDX Sample Application

MDXset = "UPDATE CUBE [Budget] SET ([Account].[Lease],[Store].[Store
20],[Category].[Forecast],[Time].[1],[Measures].[Amount]) = 10"

conAS.BeginTrans()
conAS.Execute(MDXset)
conAS.CommitTrans()
conAS.Close()

When I get the following error message:
"The operation has failed because of an attempt to update a read-only
object"

And second an alternative code using OleDB:
'Code using OleDB
Dim MDXSet As String
Dim mConn = New OleDbConnection("provider=MSOLAP;Data
Source=LocalHost;Initial Catalog=FoodMart 2000")
Dim Command As OleDbCommand
Dim mTrans As OleDbTransaction

'A simple CUBE UPDATE just in leaf member of all dimensions that works
fine in the MDX Sample Application
MDXSet = "UPDATE CUBE [Budget] SET ([Account].[Lease],[Store].[Store
20],[Category].[Forecast],[Time].[1],[Measures].[Amount]) = 10"

mConn.Open()

mTrans = mConn.BeginTransaction()
Command = New OleDbCommand
Command.Connection() = mConn
Command.CommandText() = MDXSet
Command.Transaction() = mTrans
Command.ExecuteNonQuery()
mTrans.Commit()

Getting the error message:
"Updates cannot be propagated to cube 'Budget' because it is a
read-only cube. The operation has failed because of an attempt to
update a read-only object"

I also tried to use this ConnectionString:

"provider=MSOLAP;Data Source=localhost;Initial Catalog=FoodMart 2000;"
& _
"Writeback Timeout=300;Cache Ratio=0.1;Cache Ratio2=0.1;Default
Isolation Mode=0;Execution Location=3;Client Cache Size=0;Secured Cell
Value=3;"

But even so the error persists!

Does anybody can help me??

I really have no idea what else I could try about it!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.