MS-SQL Conection Problem


I know there are some topics in this Forum, but none of them where solving my problem.

My problem:

I tried to connect to a MS-SQL database.


		'connectionString' => 'mssql:host=;dbname=kws',

		'emulatePrepare' => false,

		'username' => 'schulung',

		'password' => 'schulung',


The database is not local.

The extensions for php are loaded:


I got the following Error message:

CDbConnection failed to open the DB connection: SQLSTATE[HY000] General SQL Server error: Check messages from the SQL Server. (severity 5)

I hope i can get it working till the end of this weekend.


If you running this on *nix, try to connect to MS-SQL via dblib:

'connectionString' => 'dblib:host=;dbname=kws',  

I use mssql on Windows and dblib on *nix for working with MS-SQL via Yii/PDO and all works fine.

Here: man had the same error, and in next post he say’s that problem was with DB name

Found the problem. It was the too old driver. With the new driver it is working.

Helo huseldusel,

you can tell me step by step how you connect to SQL Server with Yii, I’ve tried everything.

Thank you very much.