2009年4月14日星期二

[fw-db] MsSQL connection via DBLIB driver

Hi! The case is under os x and zend framework. I've got quiete a trouble here. define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application/')); set_include_path(APPLICATION_PATH . '/../library' . PATH_SEPARATOR . get_include_path()); require_once "Zend/Loader.php"; Zend_Loader::registerAutoload(); try { $config = array( 'host' => '192.168.0.1', 'username' => 'one', 'password' => '123', 'dbname' => 'one', 'pdoType' => 'dblib' ); //one part not working $db = Zend_Db::factory('Pdo_Mssql', $config)->getConnection(); $q = $db->fetchAll('SELECT @@VERSION'); print_r($q); //working part $server = '192.168.0.1'; $link = mssql_connect($server, 'one', '123'); if(!$link){die('Something went wrong while connecting to MSSQL');} mssql_select_db('one',$link); mssql_query('SET QUOTED_IDENTIFIER ON'); $q = mssql_query('SELECT @@VERSION'); while($row = mssql_fetch_array($q)){ print_r($row); } } catch (Zend_Db_Adapter_Exception $e){ die($e->getMessage()); } First part while connecting via factory i get "The dblib driver is not currently installed" but usual connection via mssql works fine Tried pdoType = sybase, dblib, fretds, mssql Any ideas? By the way - all including roots are all right.

View this message in context: MsSQL connection via DBLIB driver
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: