title: Zend Framework and SQL Server
body: <p>I'm trying to use Zend Framework with SQL server 2005 express (through Pdo_Mssql with <a href="http://www.wampserver.com/en/" rel="nofollow noreferrer">wamp</a> installation) but seem that pdo can't connect to SQL. 
  This is my code:</p>
  
  <pre><code>require '../application/bootstrap.php'; 
  
  try {
      $db = Zend_Db::factory('Pdo_Mssql', array(
      'host'     =&gt; 'localhost',
      'username' =&gt; 'sa',
      'password' =&gt; 'verystrongpass',
      'dbname'   =&gt; 'msdb'
  ));
      $db-&gt;getConnection();
  } catch (Zend_Db_Adapter_Exception $e) {
      $e-&gt;getMessage();
  } catch (Zend_Exception $e) {
     $e-&gt;getMessage();
  }
  
  
  $sql = 'SELECT * FROM table';
  
  $result = $db-&gt;fetchAll($sql);
  
  echo "----------------" . var_dump($result);
  </code></pre>
  
  <p>and the error result is always:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception
    'Zend_Db_Adapter_Exception' with
    message 'SQLSTATE[01002] <strong>Unable to
    connect: SQL Server is unavailable or
    does not exist</strong>. (severity 9)' in
    C:\wamp\bin\php\php5.2.5\lib\Zend\Db\Adapter\Pdo\Abstract.php:130
    Stack trace: #0
    C:\wamp\bin\php\php5.2.5\lib\Zend\Db\Adapter\Pdo\Mssql.php(135):
    Zend_Db_Adapter_Pdo_Abstract->_connect()</p>
    
    <p>1
    C:\wamp\bin\php\php5.2.5\lib\Zend\Db\Adapter\Abstract.php(389):Zend_Db_Adapter_Pdo_Mssql->_connect()</p>
    
    <p>2
    C:\wamp\bin\php\php5.2.5\lib\Zend\Db\Adapter\Pdo\Abstract.php(205):Zend_Db_Adapter_Abstract->query('SELECT
    * FROM t...', Array) </p>
    
    <p>3
    C:\wamp\bin\php\php5.2.5\lib\Zend\Db\Adapter\Abstract.php(616):
    Zend_Db_Adapter_Pdo_Abstract->query('SELECT
    * FROM t...', Array) </p>
    
    <p>4 C:\Documents and
    Settings\Luca\Documenti\Workspace\web\db\public\index.php(27):
    Zend_Db_Adapter_Abstract->fetchAll('SELECT * FROM t...') #5 {main} thrown in C:\wamp\bin\php\php5.2.5\lib\Zend\Db\Adapter\Pdo\Abstract.php
    on line 130</p>
  </blockquote>
  
  <p>So anyone have some experience with ZF + SQL server, SQL server need some special configuration? In istallation time i've only specify to use the default istance and to use mixed authentication. Moreover I can successful connect with db through Microsoft SQL server management studio express.</p>