<?php 

include("adodb5/adodb.inc.php");

$db_array['local sqlserver']['type']='mssql'; 
$db_array['local sqlserver']['host']='localhost'; 
$db_array['local sqlserver']['port']='1433'; 
$db_array['local sqlserver']['name']='adventure'; 
$db_array['local sqlserver']['user']='sa'; 
$db_array['local sqlserver']['pass']='welcome123';  

$connection_name="local sqlserver"; //change this to the connection name from the above file
//& ADONewConnection('mssql');
	$conn = & ADONewConnection($db_array['local sqlserver']['type']);
$cstr = "Driver={SQL Server};SERVER=localhost;PORT=1433;DATABASE=adventure;";	

	/*$cstr = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST={$db_array[$conn_name]['host']})(PORT={$db_array[$conn_name]['port']}))
			(CONNECT_DATA=(SID={$db_array[$conn_name]['name']})))";
			*/
//$conn ->Connect($db_array[$connection_name]['host'].",".$db_array[$connection_name]['port'], $db_array[$connection_name]['user']);			
	$conn->Connect($cstr, $db_array[$conn_name]['user'], $db_array[$conn_name]['pass']);
	//$conn->debug = true;
$sql=<<<SOD
Select 
       aad."AddressID" ,
       aad."AddressLine1" ,
       aad."AddressLine2" ,
       aad."City" ,
       aad."StateProvinceID" ,
       aad."PostalCode" ,
       aad."rowguid" ,
       aad."ModifiedDate"
From 
      "AdventureWorks"."Person"."Address"    aad
SOD;
	    $rs1 = $conn->Execute($sql); 
if (!$rs1) echo "error";
    print "<pre>"; 
    print_r($rs1->GetRows()); 
    print "</pre>"; 
?>