Friday, February 24, 2012

AMO Role Creation

Hi,

I have just created a role using AMO. I'm supposed to see this role in the Analysis Services Project once I open it, right? But I cannot. I tried executing again my codes, and it prompted me an error, which means that it was created successfully.

Error:

Another 'Role' object has the 'TestRole' name.

Why can I not see that in the AS Project?

By here is my code:

Svr = New Server

Svr.Connect("Data Source=localhost")

DB = Svr.Databases("AS17")

Cub = DB.Cubes("Test")

UserRole = DB.Roles.Add("TestRole")

UserRole.Members.Add(New RoleMember("xa\chemps"))

UserRole.Update()

thanks a lot!

cherriesh

The role you created using AMO will exist on your server. If you are using a standard project (not in online mode) you will not see changes that are made on the server. You can use the "import 9.0 database" option in BIDS to create a new project based on a database on the server, or you can connect BIDS directly to the server in online mode or use SSMS to see the role. Changes made to the server are not automatically propogated back to a project.

|||

Hi,

The server is my localhost. How do i know if my project is in online mode? I already deployed and processed it before i created the roles in AMO and run it. In SSMS, where can I find there the role?

Thanks a lot!

cherriesh.

|||

If from BIDS, you go File -> Open Analysis Service Database and open the database from your localhost, then you are in online mode, but if BIDS was open when you created the role you would need to refresh or re-open to see the new role.

But if are doing a file -> open project, or clicking on an entry in the recent projects list, then you are in off line mode (which is the recommended way of working)

In SSMS you connect to the SSAS server, expand the databases in the object browser and then expand the roles. Once again, if you create the role while SSMS is open you would need to refresh the roles node.

No comments:

Post a Comment