Tcp port addressing and runtime for ADOMD.Net
May 20, 2011 Leave a comment
For SQL Server database instances, we specify custom ports in connection string as serverName,portName (seperated by comma). But in case of SQL Server Analysis Services, the convention is serverName:portName. Although the colon syntax is more common for tcp clients in general, but SQL Server database engine deviation created an incorrect assumption that the comma syntax will be used consistently across all microsoft products.
Another confusion in the mix was the minimal runtime requirements for SSAS .Net client. The search of word ‘runtime’ for SSAS didn’t yield any useful results. Accompanying this with errors below leads to confusion of COM registration, OLEDB requirements, etc.
The different types of errors including
Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException: A connection cannot be made. Ensure that the server is running. ---> System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found
Microsoft.AnalysisServices.AdomdClient.AdomdErrorResponseException: Class not registered
COMException (0x80040154): Retrieving the COM class factory for component with CLSID {B9776FC2-70D8-4664-A0DF-998114524D67} failed due to the following error: 80040154. Microsoft.AnalysisServices.AdomdClient.IXMLAStream..ctor() +32
SQL Browser service is missing
After trying several things (including regsvr32 msadomdx.dll), installing different SQL Server version ADOMD msi and ADOMD OLEDB msi for both 2005 and 2008, the solution narrowed down to two simple things:
1. We were using .Net 4.0 with SSAS 2005 via ADOMD.Net on Windows 2008 R2. On the web server which renders SSAS data, SQL Server 2008 R2 ADOMD.Net was the only required installation. This can be located by searching for ‘SQL Server feature pack’.
2. Use proper connection string. Below is a simple aspx test page which connects at a custom port (1234):
<%
try {
Microsoft.AnalysisServices.AdomdClient.AdomdConnection cn = new Microsoft.AnalysisServices.AdomdClient.AdomdConnection();
cn.ConnectionString = "Data source=SSASHost:1234;Provider=MSOLAP.2;Initial Catalog=myCatalog; Integrated Security=SSPI";
cn.Open();
Response.Write("OK");
}
catch (Exception ex) {
Response.Write(ex.ToString());
}
%>



