If you're doing the following, this is for you:
- Installing Community Server 2.0 on a shared host
- Using the web-based installer at <your domain>/Installer/Default.aspx
- Connecting to SQL Server using SQL Server authentication
What you will find is that when you try to select the database for your Community Server site, you'll receive an error message similar to "Error 18456: Message: Login failed for user '<username>'". And no matter how many times you mess with your user name and password, the error will still occur.
If you want to fix this problem, do the following:
- Open file Installer/default.aspx file in VS.NET.
- Search for "TextMode". You'll wind up in the asp:textbox element for db_password.
- Delete the TextMode attribute and its value.
- Upload your hacked Installer/default.aspx to your website.
Your password won't be masked, but then it probably doesn't matter. You're installing once, right?
Why does this error occur?
It occurs because the db_password textbox in Installer/Default.aspx has its TextMode property set to "Password". When you enter the password into the wizard and click Next, the password *is* posted back to the server. However, default.aspx doesn't preserve it. And ASP.NET won't preserve it either because sending it back to the client on a postback would be a security risk.
So when you are at the Select Database page, your password is gone and db_password.Text is empty again. The code that builds the connection string pulls the password from db_password, producing a connection string with empty password. And so the error occurs.
--
Sean Winstead
Tags: CommunityServer