Connecting to microsoft sql server


#1

Hello! This php code works wonderful:

$serverName = "111.11.111.111\SQLOLEDB, 1111"; 
$connectionInfo = array( "Database"=>"TEST", "UID"=>"test", "PWD"=>"test");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

But when trying the same in cakephp, I got an error: "Error: SQLSTATE[08001]: [Microsoft][ODBC Driver 13 for SQL Server]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. "

This is the connection code:

'esanet' => [
            'className' => 'Cake\Database\Connection',
            'driver' => 'Cake\Database\Driver\Sqlserver',
            'persistent' => false,
            'host' => '111.11.111.111\SQLOLEDB',
            'port' => '1111',
            'username' => 'test',
            'password' => 'test',
            'database' => 'TEST',
            'encoding' => 'utf8',
            'timezone' => 'UTC',
            'cacheMetadata' => true,
            'log' => false,
            'quoteIdentifiers' => false,

            'url' => env('DATABASE_URL', null),
        ],

Any ideas?? I already tried removing the “sqloledb”