Tuesday, October 23, 2007

OWC connectionstring problem

Today I experienced a strange problem with office web components. My intention was to connect to a SSAS 2005 machine located on another domain by sting username and password in the connectionstring. Notice that this is done without using a HTTP-connection. The connectionstring I entered was: "ConnectTo=9.0;Provider=MSOLAP.3;Password=password;Persist Security Info=True;User ID=domain\username;Initial Catalog=MyTestDB;Data Source=10.10.10.10".

When I tried this I recieved an error: The peer prematurely closed the connection
So I created a javascript function that returned the currently set connectionstring and it returned "ConnectTo=9.0;Provider=MSOLAP.3;Password=password;Persist Security Info=True;User ID=domainusername;Initial Catalog=MyTestDB;Data Source=10.10.10.10"

The "\"characted had been lossed so I added another "\" to the user id and it all worked smoothly.
"ConnectTo=9.0;Provider=MSOLAP.3;Password=password;Persist Security Info=True;User ID=domain\\username;Initial Catalog=MyTestDB;Data Source=10.10.10.10"

No comments: