title: Connecting to an MSSQL database through ODBC Error
body: <p>Where to start..</p>
  
  <ul>
  <li>I have a server with windows 2008 R2 standard 32 bits.</li>
  <li>On that server ISS 7 is installed and a php site is added but requires databases.</li>
  <li>Made an sql database on that server wich is called 'test'.</li>
  <li>ODBC connection is made and tested and it succeeded.</li>
  <li><p>Now when I use this php code to connect to the server it gives me:</p>
  
  <p>Can not connect because the target machine actively refused it.</p></li>
  </ul>
  
  <p>php code:</p>
  
  <pre><code>&lt;?
  ### Database    ###
  $user = "*****"; //database user
  $pass = "*****";    //database password
  $host = "localhost";   //database location
  $db = "test";     //database name
  ##mysql_connect ("$host","$user","$pass");
  ##mysql_select_db("$db");
  $dbConn = odbc_connect("$db","$user","$pass","$host") or die(odbc_errormsg());
  ?&gt;
  </code></pre>
  
  <p>The password and username are correct but the error still remains.</p>
  
  <p>Any help is appreciated!</p>