Index: library/Zend/Db/Adapter/Pdo/Mssql.php =================================================================== --- library/Zend/Db/Adapter/Pdo/Mssql.php (revision 17835) +++ library/Zend/Db/Adapter/Pdo/Mssql.php (working copy) @@ -43,7 +43,7 @@ * * @var string */ - protected $_pdoType = 'mssql'; + protected $_pdoType = ''; /** * Keys are UPPERCASE SQL datatypes or the constants @@ -100,7 +100,7 @@ // this driver supports multiple DSN prefixes // @see http://www.php.net/manual/en/ref.pdo-dblib.connection.php - if (isset($dsn['pdoType'])) { + if (!empty($dsn['pdoType'])) { switch (strtolower($dsn['pdoType'])) { case 'freetds': case 'sybase': @@ -115,6 +115,13 @@ break; } unset($dsn['pdoType']); + } else { + $avaliableDrivers = PDO::getAvailableDrivers(); + $suitedDrivers = array('mssql', 'dblib', 'sybase'); + $avaliableSuitedDrivers = array_intersect($avaliableDrivers, $suitedDrivers); + if (count($avaliableSuitedDrivers)) { + $this->_pdoType = array_shift($avaliableSuitedDrivers); + } } // use all remaining parts in the DSN @@ -420,4 +427,4 @@ return null; } } -} \ No newline at end of file +}