title: Having Issues Connecting to Microsoft SQL Server Express (2008) from PHP
body: <p>As the title says, I'm having issues connecting to MSSQL from a PHP Script.</p>
  
  <p>The setup:-</p>
  
  <ul>
  <li>PHP is running on an Apache Linux Server.</li>
  <li>Microsoft SQL Server 2008 is on an XP Machine.</li>
  <li>I've got Remote Connections turned on in the MSSQL Server.</li>
  <li>The database bggs does exist.</li>
  <li>The database is running (I can see a green arrow).</li>
  <li>I have no firewall on the XP Machine.</li>
  </ul>
  
  <p>If you have any debugging questions, don't hesitate to ask.</p>
  
  <p><strong>I'm using the following test script.</strong></p>
  
  <pre><code>&lt;?php
      include('adodb5/adodb.inc.php');
      $db =&amp; ADONewConnection('odbc_mssql');
      $db-&gt;debug = true;
      $dsn = "Driver={SQL Server};Server=ozmodiar;Database=bggs;";
      $db-&gt;Connect($dsn,'user','password');
      $rs = $db-&gt;Execute('select * from admin_users');
      print "&lt;pre&gt;";
      print_r($rs-&gt;GetRows());
      print "&lt;/pre&gt;";
  ?&gt;
  </code></pre>
  
  <p><strong>Getting the following result.</strong></p>
  
  <p>Warning: odbc_connect() [function.odbc-connect]: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /mnt/filestore/vhost/bggs/hr_database/Dev/includes/adodb5/drivers/adodb-odbc.inc.php on line 60
  (odbc_mssql): SET CONCAT_NULL_YIELDS_NULL OFF<br>
  Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in /mnt/filestore/vhost/bggs/hr_database/Dev/includes/adodb5/drivers/adodb-odbc.inc.php on line 530
  IM002: [unixODBC][Driver Manager]Data source name not found, and no default driver specified</p>
  
  <p>ADOConnection._Execute(SET CONCAT_NULL_YIELDS_NULL OFF, false) % line 1017, file: adodb.inc.php
  ADOConnection.Execute(SET CONCAT_NULL_YIELDS_NULL OFF) % line   62, file: adodb-odbc.inc.php
  ADODB_odbc._connect(Driver={SQL Server};Server=192.168.70.130;Database=bggs;, sa, knd121, ) % line  524, file: adodb.inc.php
  ADOConnection.Connect(Driver={SQL Server};Server=192.168.70.130;Database=bggs;, sa, knd121) % line    9, file: test_db.php</p>
  
  <p>Driver={SQL Server};Server=192.168.70.130;Database=bggs;: [unixODBC][Driver Manager]Data source name not found, and no default driver specified
  (odbc_mssql): select * from admin_users<br>
  Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in /mnt/filestore/vhost/bggs/hr_database/Dev/includes/adodb5/drivers/adodb-odbc.inc.php on line 530
  IM002: [unixODBC][Driver Manager]Data source name not found, and no default driver specified</p>
  
  <p>ADOConnection._Execute(select * from admin_users, false) % line 1017, file: adodb.inc.php
  ADOConnection.Execute(select * from admin_users) % line   10, file: test_db.php</p>
  
  <p>Fatal error:  Call to a member function GetRows() on a non-object in /mnt/filestore/vhost/bggs/hr_database/Dev/includes/test_db.php on line 12</p>