title: Codeigniter 2.0.3 with SQL Server Active Record
body: <p>I'm working on upgrading a Codeigniter app I have running on 1.7.2 to 2.0.3 but I'm not able to connect to SQL Server .  Both versions are running on the same server running php 5.2.10 and connecting to the same SQL Server.</p>
  
  <p>This is the error from CI 2.0.3</p>
  
  <pre><code>Unable to connect to your database server using the provided settings.
  Filename: core/Loader.php
  Line Number: 260
  </code></pre>
  
  <p>This is the connection string I'm using which of course works on 1.7.2</p>
  
  <pre><code>$db['reports']['hostname'] = "mysqlserver";
  $db['reports']['username'] = "sqluser";
  $db['reports']['password'] = "sqlpass";
  $db['reports']['database'] = "SQLReportDB";
  $db['reports']['dbdriver'] = "mssql";
  $db['reports']['dbprefix'] = "";
  $db['reports']['pconnect'] = TRUE;
  $db['reports']['db_debug'] = TRUE;
  $db['reports']['cache_on'] = FALSE;
  $db['reports']['cachedir'] = "";
  $db['reports']['port']     = 972;
  </code></pre>
  
  <p>In the controller I call the connection with this</p>
  
  <pre><code>$report_db = $this-&gt;load-&gt;database('reports', TRUE);
  </code></pre>
  
  <p>Below is the function in the loader file where it reports the failure.
  Line 260 is <code>return DB($params, $active_record);</code></p>
  
  <pre><code>/**
   * Database Loader
   *
   * @param   string  the DB credentials
   * @param   bool    whether to return the DB object
   * @param   bool    whether to enable active record (this allows us to override the config setting)
   * @return  object
   */
  public function database($params = '', $return = FALSE, $active_record = NULL)
  {
      // Grab the super object
      $CI =&amp; get_instance();
  
      // Do we even need to load the database class?
      if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI-&gt;db) AND is_object($CI-&gt;db))
      {
          return FALSE;
      }
  
      require_once(BASEPATH.'database/DB.php');
  
      if ($return === TRUE)
      {
          return DB($params, $active_record);
      }
  
      // Initialize the db variable.  Needed to prevent
      // reference errors with some configurations
      $CI-&gt;db = '';
  
      // Load the DB class
      $CI-&gt;db =&amp; DB($params, $active_record);
  }
  </code></pre>