I’m trying now for hours to get my yii app to work with a MS sql db, I read any articel in the web that is providet by google, but I don’t get it!!! ;(
My Yii connection string is:
'connectionString'=>'mssql:host=SERVER\SQLEXPRESS;dbname=dbname', 'username'=>'sa', 'password'=>'sql_server_pass', 'charset'=>'utf8'
And I get the exception:
SQLSTATE Unable to connect: SQL Server is unavailable or does not exist. Access denied. (severity 9)
But I use the same login data in Visual Studio (Also on my local pc, not on SERVER) and there everything works fine.
I have no ideas, maybe Apache or PHP blocks the connection, I don’t know ;(
Any ideas Guys?
My System is Windows (Both, server and my client) and on my client I have installed "wampserver 2.0h"
Unbelievble, my last try was to copy a dll in the apache/bin folder and know I got a different exception, mybe better???
SQLSTATE[HY000]: General error: 10007 ‘NAMES’ wird nicht als SET-Option erkannt.  (severity 5) 
General error: 10007 ‘NAMES’ is not known as SET-option.  (severity 5) 
try commenting out the line “‘charset’=>‘utf8’”.
with mssql you need to provide the charset within the dsn.
I always use this in my config (to connect to MSSQL)
'connectionString' => 'mssql:host=192.168.1.13;dbname=MyDB', 'username'=>'sa', 'password'=>'mypwd'
host is my computer’s IP number