diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php b/lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php index 2b84a0fcf81..a9be26e9dea 100644 --- a/lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php +++ b/lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php @@ -31,8 +31,13 @@ public function connect(array $params, $username = null, $password = null, array $driverOptions['CharacterSet'] = $params['charset']; } - $driverOptions['UID'] = $username; - $driverOptions['PWD'] = $password; + if ($username !== null) { + $driverOptions['UID'] = $username; + } + + if ($password !== null) { + $driverOptions['PWD'] = $password; + } if (! isset($driverOptions['ReturnDatesAsStrings'])) { $driverOptions['ReturnDatesAsStrings'] = 1;