• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/db/mssqldbconnection.php
  • Класс: BitrixMainDBMssqlDbConnection
  • Вызов: MssqlDbConnection::connectInternal
protected function connectInternal()
{
	if ($this->isConnected)
		return;

	$connectionInfo = array(
		"UID" => $this->dbLogin,
		"PWD" => $this->dbPassword,
		"Database" => $this->dbName,
		"ReturnDatesAsStrings" => true,
		/*"CharacterSet" => "utf-8",*/
	);

	if (($this->dbOptions & self::PERSISTENT) != 0)
		$connectionInfo["ConnectionPooling"] = true;
	else
		$connectionInfo["ConnectionPooling"] = false;

	$connection = sqlsrv_connect($this->dbHost, $connectionInfo);

	if (!$connection)
		throw new ConnectionException('MS Sql connect error', $this->getErrorMessage());

	$this->resource = $connection;
	$this->isConnected = true;

	global $DB, $USER, $APPLICATION;
	if ($fn = BitrixMainLoader::getPersonal("php_interface/after_connect.php"))
		include($fn);
}