Connecting to MS SQL database as secondary database connection Failing
instead of 'driver' => 'c5_pdo_mysql' i used 'driver' => 'c5_pdo_sqlsrv',
but then ran into an error because there was not class for it, so I created
Now i get error
Class '\Concrete\Core\Database\Driver\PDOSqlsrv\Driver' not found
Though the file is there.
Maybe I just went in the wrong direction. Any assisntance is appreciated.
By default ONLY the c5_pdo_mysql driver is registered, you need to register the appropriate driver. So you database.php file in your config might end up looking something closer to this:
<?php return array( 'default-connection' => 'concrete', 'drivers' => array( 'pdo_sqlsrv' => 'Doctrine\DBAL\Driver\SQLSrv\Driver' ), 'connections' => array( 'concrete' => array( 'driver' => 'c5_pdo_mysql', 'server' => 'localhost', 'database' => 'c5', 'username' => 'uuuuuuuuu', 'password' => 'pppppppppp', 'charset' => 'utf8', ),
Notice how I had to register my driver as 'pdo_sqlsrv', and map it to an actual driver implementation class. You'll need to find the appropriate driver for your needs. Best of luck!
'pdo_sqlsrv' => 'Doctrine\DBAL\Driver\PDOSqlsrv\Driver'
only thing is now i get an error
Call to undefined method Doctrine\DBAL\Driver\PDOStatement::fetchRow()
Im going to try to get SQLSrv installed on on server, but not sure if that will do it.
For a list of these check out Concrete\Core\Database\Driver\PDOStatement they are just there for backwards compatibility but you shouldn't be using them in new development.