title: CI connect to SQL SERVER
body: <p>i want to connect to sql server my php version is 5.4 and i have MS SQL Server 2008 R2 and i use PHP Codeigniger 2.1.4
  i use sqlsrv30.exe
  i use XAMPP 1.8.2</p>
  
  <p>i change database.php config</p>
  
  <pre><code>$db['default']['hostname'] = '192.168.5.208';
  $db['default']['username'] = 'xxx';
  $db['default']['password'] = 'xxx';
  $db['default']['database'] = 'xxx';
  $db['default']['dbdriver'] = 'sqlsrv';
  $db['default']['dbprefix'] = '';
  $db['default']['pconnect'] = TRUE;
  $db['default']['db_debug'] = TRUE;
  $db['default']['cache_on'] = FALSE;
  $db['default']['cachedir'] = '';
  $db['default']['char_set'] = 'utf8';
  $db['default']['dbcollat'] = 'utf8_general_ci';
  $db['default']['swap_pre'] = '';
  $db['default']['autoinit'] = TRUE;
  $db['default']['stricton'] = FALSE;
  </code></pre>
  
  <p>i download sqlsrv30.exe. install it in php/ext</p>
  
  <p>i add the following on the php.ini file:</p>
  
  <pre><code>extension=php_sqlsrv_54_ts.dll
  </code></pre>
  
  <p>i install Native Client 10</p>
  
  <p>i change sqlsrv_driver.php in folder database-driver-sqlsrv to</p>
  
  <pre><code>function db_pconnect() {
          //return $this-&gt;db_connect(TRUE);
          return $this-&gt;db_connect(TRUE);
      }
  </code></pre>
  
  <p>i also try add</p>
  
  <pre><code>db['default']['port'] = 1433;
  </code></pre>
  
  <p>but its still not working. I always encountered the ff. error:</p>
  
  <pre><code>A Database Error Occurred
  Unable to connect to your database server using the provided settings.
  Filename: C:\xampp\htdocs\HRM\system\database\DB_driver.php
  Line Number: 124
  </code></pre>
  
  <p>Please help...</p>