I am trying to connect CakePHP 2.2.2 stable version with MS SQL database.
Below is db connection that I’m using:
public $default = array(
'datasource' => 'Database/Mssql',
'persistent' => false,
'host' => '192.192.1.1',
'login' => 'username',
'password' => 'password',
'database' => 'dbname',
'prefix' => '',
//'encoding' => 'utf8',
);
When I connect with CorePHP – it works, So all credentials I use are correct however when I connect with CakePHP 2.2.2 version, returns below error:
Cake is NOT able to connect to the database.
Datasource class Mssql could not be found.
I have following files in my dbo library on path: cakephp/lib/Cake/Model/Datasource/Database
Mysql.php
Postgres.php
Sqlite.php
Sqlserver.php
So I believe that all files required for MS SQL Server connection is present in my Cake version.
Let me know what I am missing or having problem with.
Thanks in advance !
i think the correct datasource string is ‘Sqlserver’ and not ‘mssql’.