--- C:/Users/Genius.COMPENG/Desktop/database_api.php Ïò àïð 23 14:28:34 2010 +++ //iserv/e$/Mantis/web/core/database_api.php ×ò èþí 17 10:57:12 2010 @@ -161,6 +161,9 @@ case 'odbc_mssql': $t_support = function_exists( 'odbc_connect' ); break; + case 'mssqlnative': + $t_support = function_exists( 'sqlsrv_connect' ); + break; default: $t_support = false; } @@ -211,6 +214,7 @@ switch( $t_db_type ) { case 'mssql': case 'odbc_mssql': + case 'mssqlnative': return true; } @@ -304,7 +308,7 @@ static $s_check_params; if( $s_check_params === null ) { - $s_check_params = ( db_is_pgsql() || config_get_global( 'db_type' ) == 'odbc_mssql' ); + $s_check_params = ( db_is_pgsql() || config_get_global( 'db_type' ) == 'odbc_mssql' || config_get_global( 'db_type' ) == 'mssqlnative'); } if( ON == $g_db_log_queries ) { @@ -331,6 +335,13 @@ if( $arr_parms[$i] === false ) { $arr_parms[$i] = 0; } + if( config_get_global( 'db_type' ) == 'mssqlnative' && is_bool($arr_parms[$i])) + { + if($arr_parms[$i]) + $arr_parms[$i] =1; + else + $arr_parms[$i] =0; + } } } @@ -443,7 +454,7 @@ } # mysql obeys FETCH_MODE_BOTH, hence ->fields works, other drivers do not support this - if( $g_db_type == 'mysql' || $g_db_type == 'odbc_mssql' ) { + if( $g_db_type == 'mysql' || $g_db_type == 'odbc_mssql' || $g_db_type == 'mssqlnative' ) { $t_array = $p_result->fields; $p_result->MoveNext(); return $t_array; @@ -537,6 +548,11 @@ $result = db_query_bound( $query ); return db_result( $result ); } + if( db_is_mssql()){ + $query = "SELECT IDENT_CURRENT('".$p_table . "')"; + $result = db_query_bound( $query ); + return db_result( $result); + } return $g_db->Insert_ID(); } @@ -677,6 +693,7 @@ switch( $t_db_type ) { case 'mssql': + case 'mssqlnative': case 'odbc_mssql': case 'ado_mssql': if( ini_get( 'magic_quotes_sybase' ) ) { @@ -728,6 +745,7 @@ switch( $t_db_type ) { case 'mssql': + case 'mssqlnative': case 'odbc_mssql': case 'ado_mssql': $content = unpack( "H*hex", $p_string );