Skip to content

Commit

Permalink
Merge pull request #18 from owncloud/fixing-sqlserver-master
Browse files Browse the repository at this point in the history
Fixing sqlserver master
  • Loading branch information
DeepDiver1975 committed Mar 12, 2013
2 parents 737b785 + 2c5a4c9 commit 63cb284
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion MDB2/Driver/Manager/sqlsrv.php
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ function listTables($database = null)
return $db;
}

$query = 'EXEC sp_tables @table_type = "\'TABLE\'"';
$query = 'EXEC sp_tables @table_type = "\'TABLE\'", @table_owner = "dbo"';
$table_names = $db->queryCol($query, null, 2);
if (PEAR::isError($table_names)) {
return $table_names;
Expand Down
18 changes: 11 additions & 7 deletions MDB2/Driver/sqlsrv.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,11 @@ function _doConnect($username, $password, $database=null, $persistent = false)
$host .= ','.$this->dsn['port'];
}

$connection = @sqlsrv_connect($host, $params);
if (!empty($this->dsn['charset'])) {
$params['CharacterSet'] = $this->dsn['charset'];
}

$connection = @sqlsrv_connect($host, $params);
if (!$connection) {
return $this->raiseError(MDB2_ERROR_CONNECT_FAILED, null, null,
'unable to establish a connection', __FUNCTION__, __FUNCTION__);
Expand All @@ -345,12 +349,12 @@ function _doConnect($username, $password, $database=null, $persistent = false)
$this->connected_database_name = $database;
}

if (!empty($this->dsn['charset'])) {
$result = $this->setCharset($this->dsn['charset'], $connection);
if (PEAR::isError($result)) {
return $result;
}
}
// if (!empty($this->dsn['charset'])) {
// $result = $this->setCharset($this->dsn['charset'], $connection);
// if (PEAR::isError($result)) {
// return $result;
// }
// }

if (empty($this->dsn['disable_iso_date'])) {
@sqlsrv_query($connection,'SET DATEFORMAT ymd');
Expand Down

0 comments on commit 63cb284

Please sign in to comment.