Tuesday, 20 March 2012

Connect to Analysis Services with specific username

Hello,

We are trying to develop an ASP .Net web application that connects to an SQL Server 2005 analysis services and executes MDX statements. We want the connection to be made using a specific user name that we specify in the code rather than having the web application inherit the logged on domain user account.

We tried to specifiy the user name in the connection string as follows, but it is still taking the logged in user account rather than the one specified.

Microsoft.AnalysisServices.Server s = new Microsoft.AnalysisServices.Server();

s.Connect("Provider=MSOLAP.3;Password=123;Persist Security Info=True;User ID=domain\username;Data Source=<server ip>;Initial Catalog=<analysis DB>");

Is this possible?

Note that if we are using the OLEDB 9.0 provider for Analysis Services to connect an excel sheet to the analysis database we can easily specify the user name and password, so is there a similar way to do the same from a .Net application?

Any feedback is appreciated, thanks,

Grace

If you want to use a Windows Indentity, then you can′t. For other connection options refer to the connection properties which are shown e.g. here:

http://www.ssas-info.com/ssas_articles/ssas_articles/analysis_services_2000_and_2005_connection_string_properties.html


Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

Thanks Jens,

The link helped a lot. We were able to connect using specific Roles and that is what we were looking for exactly but didn't know it exists.

Grace

No comments:

Post a Comment