Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

MSSQL (dblib): Driver does not support this function

$
0
0
Hi all

I would like to connect to a remote MS-SQL Server with the pdo_dblib driver (freetds) on CentOS 5.5.
After some minor problems with the OS configuration, I finally got the connection working with a manual connect with
$connection=new CDbConnection($dsn,$username,$password); 

Unfortunately, when using the Yii database component (as specified in config/main.php) I get the following error:

Quote

CDbConnection failed to open the DB connection: SQLSTATE[IM001]: Driver does not support this function: driver does not support setting attributes

when I try to retrieve the connection with this code in my Controller:
$connection = Yii::app()->db;


My db settings are as follows:
'db'=>array(
	'connectionString' => 'dblib:host=SERVER_IP;dbname=DB',
	'emulatePrepare' => false,
	'username' => 'USER',
	'password' => 'PASS',
	'charset' => 'utf8',
),


Any ideas why this is happening?
I would really like to use the "shared" connection instead of create a new one every time :)

Best regards
ycast

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>