Zend Framework 2.0.5 - db connection issue with MS SQL-2005

Zend Framework 2.0.5 - db connection issue with MS SQL-2005

Postby aashah on Thu Dec 20, 2012 2:57 pm

Hi All,

I have started to work on Zend Framework 2.0.5 in which facing error while connecting with database MSSQL 2005.
Error which I got as follows,

Error : " createStatement() only accepts an SQL string or a Sqlsrv resource"

Database configuration which I have made as follows,

File : /config/autoload/global.php

"return array(
'db' => array(
'driver' => 'Sqlsrv',
'dsn' => 'sqlsrv:dbname=DATABASE_NAME;hostname="192.168.1.112\SQLExpress"',
'username' => 'sa',
'password' => 'SOME_PASSWORD',
),
'service_manager' => array(
'factories' => array(
'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory',
),
),
);"

Please guide me if I miss configure on above.
aashah
 
Posts: 8
Joined: Thu Dec 20, 2012 2:26 pm

Re: Zend Framework 2.0.5 - db connection issue with MS SQL-

Postby aashah on Thu Dec 20, 2012 4:04 pm

Hi All,

I got solution based on below link,

Code: Select all
Link : http://github[DOT]com/zendframework/zf2/issues/2678


There was issue with zend library "sqlsrv connection class"(/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Sqlsrv.php) which I have downloaded from zend framework site.
aashah
 
Posts: 8
Joined: Thu Dec 20, 2012 2:26 pm


Return to New Toolkit

Who is online

Users browsing this forum: No registered users and 3 guests