MSSQL on IIS connection problem

I use IIS bacause of many problems I had with apache and mssql express 2008

I use mssql.dll and sqlsrv.dll drivers




>> model cities

exception 'CDbException' with message 'CDbConnection failed to open the DB connection: could not find driver' in C:\Inetpub\wwwroot\yii-1.1.2\framework\db\CDbConnection.php:267



Have trouble enabling pdo_mssql.dll and probably it’s lack generates this error

My main.php




'connectionString' => 'mssql:host=TEST-KOMP\SQLEXPRESS;dbname=mgr',

// or

//'connectionString' => 'sqlsrv:host=TEST-KOMP\SQLEXPRESS;dbname=mgr',

'emulatePrepare' => true,

'username' => 'sa',

'password' => '********',

'charset' => 'utf8',



What can I do?

Are you able to connect with a plain php script?




mssql_connect('localhost,54320', 'user', 'pass')

				or die("Couldn't connect to SQL Server on localhost");



Because I’ve had a lot of trouble connecting to mssql because of a bad mssql.dll

mssql_connect(‘TEST-KOMP\SQLEXPRESS’, ‘sa’, ‘********’)

does the trick…

@soeperees

do you have pdo_mssql enabled in your phpinfo()?

if you do, could you mail me the dll?

(the ones I’ve found on the net did not work, that is why I tried the sqlsrv.dll)

still not working…

main.php




		'db'=>array(

			'class'=>'CDbConnection',

			'connectionString' => 'mssql:host=TEST-KOMP\SQLEXPRESS;dbname=mgr',

			//'emulatePrepare' => true,

			'username' => 'sa',

			'password' => '********',

			//'charset' => 'utf8',

		),



Error




>> model cities

exception 'CDbException' with message 'CDbConnection failed to open the DB connection: could not find driver' in C:\Inetpub\wwwroot\yii-1.1.2\framework\db\CDbConnection.php:267



line 267




	protected function open()

	{

		if($this->_pdo===null)

		{

			if(empty($this->connectionString))

				throw new CDbException(Yii::t('yii','CDbConnection.connectionString cannot be empty.'));

			try

			{

				Yii::trace('Opening DB connection','system.db.CDbConnection');

				$this->_pdo=$this->createPdoInstance();

				$this->initConnection($this->_pdo);

				$this->_active=true;

			}

			catch(PDOException $e)

			{

                                // line 267 //

				throw new CDbException(Yii::t('yii','CDbConnection failed to open the DB connection: {error}',

					array('{error}'=>$e->getMessage())));

			}

		}

	}



have mssql.dll and sqlsrv.dll drivers working


mssql_connect('TEST-KOMP\SQLEXPRESS', 'sa', '********')

Connects…

if anyone has time, idea what might be wrong, pleas let me know ;)

I have the exact same problem, did you or anyone else find a solution.

I have been searching for 2 days now.