title: Cannot connect Yii with local SQL Server 2012
body: <p>I have SQL Server Express 2012 sp2 on Windows 10, PHP Version 5.5.28, Yii Version 1.1.16, Sql Native Client 11 installed</p>
  
  <p>I have followed the instructions in the following link</p>
  
  <p><a href="https://stackoverflow.com/questions/11278114/enable-remote-connections-for-sql-server-express-2012">Enable remote connections for SQL Server Express 2012</a></p>
  
  <p>but the following code works</p>
  
  <pre><code>&lt;?php
  $serverName = "localhost\\sqlexpress"; //serverName\instanceName
  $connectionInfo = array( "Database"=&gt;"ZDP", "UID"=&gt;"sa", "PWD"=&gt;"sa123123");
  $conn = sqlsrv_connect( $serverName, $connectionInfo);
  
  if( $conn ) {
       echo "Connection established.&lt;br /&gt;";
  }else{
       echo "Connection could not be established.&lt;br /&gt;";
       die( print_r( sqlsrv_errors(), true));
  }
  ?&gt;
  </code></pre>
  
  <p>but the following connection setting in Yii does not work</p>
  
  <pre><code>    'db'=&gt;array(
          'connectionString' =&gt; 'sqlsrv:Server=localhost\\SQLEXPRESS; Database=ZDP',
          'username' =&gt; 'sa',
          'password' =&gt; 'sa123123',
      ),
  </code></pre>
  
  <p>and gives the following error</p>
  
  <p>CDbConnection failed to open the DB connection: SQLSTATE[28000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Login failed for user 'sa'. </p>
  
  <p>Also note that the application was created using YII Version 1.1.13 but now i am transferring it to new system</p>