Hi,
I try to connect from the ZendFramework 1.10.3 via php_pdo_sqlsrv_52_nts.dll without success.
phpinfo shows me:
PDO section:
PDO drivers / sqlsrv
pdo_sqlsrv section:
pdo_sqlsrv support / enabled
I try to conect using the Adapter Factory Method with a Zend_Config Objekt.
Config.ini:
[general]
db.adapter = PDO_Mssql
db.params.host = "localhost"
db.params.username = WEBUser
db.params.password = WEBUser
db.params.dbname = ZFiA_Places
Bootstrap:
$db = Zend_DB::factory($config->db);
I always get this Errors:
Error: The mssql driver is not currently installed#0 C:\PHP\includes\Zend\Db\Adapter\Pdo\Mssql.php(137): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 C:\PHP\includes\Zend\Db\Adapter\Abstract.php(448): Zend_Db_Adapter_Pdo_Mssql->_connect()
#2 C:\PHP\includes\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('exec sp_columns...', Array)
#3 C:\PHP\includes\Zend\Db\Adapter\Pdo\Mssql.php(237): Zend_Db_Adapter_Pdo_Abstract->query('exec sp_columns...')
#4 C:\PHP\includes\Zend\Db\Table\Abstract.php(823): Zend_Db_Adapter_Pdo_Mssql->describeTable('places', NULL)
#5 C:\PHP\includes\Zend\Db\Table\Abstract.php(862): Zend_Db_Table_Abstract->_setupMetadata()
#6 C:\PHP\includes\Zend\Db\Table\Abstract.php(969): Zend_Db_Table_Abstract->_setupPrimaryKey()
#7 C:\PHP\includes\Zend\Db\Table\Select.php(100): Zend_Db_Table_Abstract->info()
#8 C:\PHP\includes\Zend\Db\Table\Select.php(78): Zend_Db_Table_Select->setTable(Object(Places))
#9 C:\PHP\includes\Zend\Db\Table\Abstract.php(1005): Zend_Db_Table_Select->__construct(Object(Places))
#10 C:\PHP\includes\Zend\Db\Table\Abstract.php(1303): Zend_Db_Table_Abstract->select()
I thinkthe Problem is that the PDO_Mssql Driver is named in phpinfo() with sqlsrv and not Mssql.
Have anyone an Idea whats wrong???
How can I get this thing running.
The "normal" connection over the PDO driver like this is working.
$serverName = "(local)";
$database = "AdventureWorks";
// Get UID and PWD from application-specific files.
$uid = 'WEBUser';
$pwd = 'WEBUser';
try {
$conn = new PDO( "sqlsrv:$serverName", $uid, $pwd, array( 'Database' => $database ) );
$conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}
catch( PDOException $e ) {
die( "Error connecting to SQL Server" );
}
echo "Connected to SQL Server\n";
$query = 'select * from Person.ContactType';
$stmt = $conn->query( $query );
while ( $row = $stmt->fetch( PDO::FETCH_ASSOC ) ){
print_r( $row );
}
// Free statement and connection resources.
$stmt = null;
$conn = null;


