Posted by Karl Irvin on 01/09/06 23:16
The following piece of script runs OK on my local computer but returns an
error when run on the web e.g. it's the connection process on my web that
isn't working. ISP is on Windows servers and has Access and PHP. My users
forum software (written by megga bbs in ASP) uses Access and runs OK on my
web.
------------------------------------------
<?php
$conn = new COM("ADODB.Connection")or exit('Cannot start ADO.');
//$db = "C:\\Access2003\\PHPSample.mdb"; // local path
$db = "g:\html\hostedomains\xxxx\db\PHPSample.mdb"; // web path
// domain changed to xxxx in this NG posting for security
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db");
$sql = "SELECT * FROM tProducts WHERE ProductName='Widget'";
$rs= $conn->Execute($sql);
//loops and displays data
while(!$rs->EOF)
{
$Product = $rs->Fields('ProductName');
$Price = $rs->Fields('UnitPrice');
echo "product: $Product<br>";
echo "price: " . $Price . "<br>";
$rs->MoveNext();
}
$conn->Close();
------------------------------------------
The error is:
The specified CGI application misbehaved by not returning a complete
set of HTTP headers.
------------------------------------------
Can anyone see what I need to change?
--
[Back to original message]
|