Friday, March 9, 2012

Error when assigning Dimension Data Permissions using AMO

Hello,

I am using AMO example posted on MSDN: http://msdn2.microsoft.com/en-us/library/ms345081.aspx

I followed this example very closely. I can create a role, assign read permissions to it, but when I try to

assign AllowedSet to Dimension Attribute (see code below):

// Get dimension and attribute

Dimension dim = dataBase.Dimensions.GetByName(dimName);

DimensionAttribute attr = dim.Attributes.GetByName("Group Name");

CubeDimensionPermission cubeDimPerm = cubePerm.DimensionPermissions.Add(dim.ID);

cubeDimPerm.Read = ReadAccess.Allowed;

AttributePermission attrPerm = cubeDimPerm.AttributePermissions.Add(attr.ID);

attrPerm.AllowedSet = "{[GroupUsers].[Group Name].&[0]}";

cubePerm.Update();

I am getting this error: Microsoft.AnalysisServices.AnalysisServicesClient.SendExecuteAndReadResponse(ImpactDetailCollection impacts, Boolean expectEmptyResults, Boolean throwIfError)
at Microsoft.AnalysisServices.AnalysisServicesClient.Alter(IMajorObject obj,
ObjectExpansion expansion, ImpactDetailCollection impact, Boolean allowCreate)
at Microsoft.AnalysisServices.Server.Update(IMajorObject obj, UpdateOptions o
ptions, UpdateMode mode, XmlaWarningCollection warnings, ImpactDetailCollection
impactResult)
at Microsoft.AnalysisServices.Server.SendUpdate(IMajorObject obj, UpdateOptio
ns options, UpdateMode mode, XmlaWarningCollection warnings, ImpactDetailCollect
ion impactResult)
at Microsoft.AnalysisServices.MajorObject.Update(UpdateOptions options, Updat
eMode mode, XmlaWarningCollection warnings)
at Microsoft.AnalysisServices.MajorObject.Update()
at IHS.Datawarehouse.CubeUtility.Program.AssignDimensionData(Database dataBas
e, String roleName, String dimName) in C:\IHS\WWBA\Development\Applications\IHS.
Datawarehouse.CubeUtility\IHS.Datawarehouse.CubeUtility\IHS.Datawarehouse.CubeUt
ility\Program.cs:line 99
at IHS.Datawarehouse.CubeUtility.Program.Main(String[] args) in C:\IHS\WWBA\D
evelopment\Applications\IHS.Datawarehouse.CubeUtility\IHS.Datawarehouse.CubeUtil
ity\IHS.Datawarehouse.CubeUtility\Program.cs:line 32

Has anyone experienced this error. What's causing this?

Actual error message in the event viewer:

The description for Event ID ( 22 ) in Source ( MSSQLServerOLAPService ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Internal error: An unexpected exception occured..

No comments:

Post a Comment