- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/lib/db/mssqlconnection.php
- Класс: BitrixMainDBMssqlConnection
- Вызов: MssqlConnection::connectInternal
protected function connectInternal()
{
if ($this->isConnected)
return;
$connectionInfo = array(
"UID" => $this->login,
"PWD" => $this->password,
"Database" => $this->database,
"ReturnDatesAsStrings" => true,
/*"CharacterSet" => "utf-8",*/
);
if (($this->options & self::PERSISTENT) != 0)
$connectionInfo["ConnectionPooling"] = true;
else
$connectionInfo["ConnectionPooling"] = false;
$connection = sqlsrv_connect($this->host, $connectionInfo);
if (!$connection)
throw new ConnectionException('MS Sql connect error', $this->getErrorMessage());
$this->resource = $connection;
$this->isConnected = true;
// hide cautions
sqlsrv_configure("WarningsReturnAsErrors", 0);
$this->afterConnected();
}