Db Connection using sqlsrv

I have the following db component configuration and it uses pdo_sqlsrv driver. I want to use the sqlsrv driver.


			'connectionString' => 


			'username' => 'yy',

			'password' => 'yy',

			'charset' => 'utf8',


Does Yii framework support use of sqlsrv?

Welcome to the forum.

See this thread.

Since the forum search doesn’t work very well, you can use google “site:yiiframework.com sqlsrv”


Thanks for the reply… I had gone through that thread (and a few others). The connection string used in that thread is trying to connect using pdo_sqlsrv driver. I tried to look in CDbConnection class to see which driver it chooses but in there functions like "getAvailableDrivers()" and others seems to access only pdo drivers…Can you point me how the sqlsrv in connection string is used to identify the driver?



I cannot help you with connecting from Windows at this time since I’ve so far only tried connecting from linux. At least you should have a pdo_sqlsrv driver installed, check phpinfo().

Here’s another thread in case you haven’t read it. Edit: seems like it’s linux related.

BTW here’s a link to the phppdo extension, but I don’t know if it will be of any use in this case. (It’s a replacement for PDO.)