Hi Folks,
I don't seem to be able to get DB::execute to work using an ODBC
datasource and a MS-Access Database.
Can anyone tell me if I am doing something wrong, or is there a bug in
the DB class?
Code fragment is below.
Regards,
Martin
<?php
require_once "DB.php";
$dsn ="odbc(acces s)://tcp()driver=Mic rosoft Access Driver
(*.mdb);dbq=C:\ \PrjData\\TestS cripts\\TestScr ipt.mdb";
$conn = DB::connect ($dsn);
if (DB::isError ($conn))
die ("Cannot connect: " . $conn->getMessage () . "\n");
$updateQuery="U PDATE Book1 SET SubCategory = ? WHERE ID = ?;";
$sth = $conn->prepare($updat eQuery);
if (PEAR::isError( $sth))
{
die($sth->getMessage() );
}
echo "<br> Prepare OK <br>";
$data = array('1','1');
//print_r($data);
$res1 =& $conn->execute($sth , $data);
if (PEAR::isError( $res1))
{
die($res1->getMessage() );
}
echo "Update OK <br>";
?>
I don't seem to be able to get DB::execute to work using an ODBC
datasource and a MS-Access Database.
Can anyone tell me if I am doing something wrong, or is there a bug in
the DB class?
Code fragment is below.
Regards,
Martin
<?php
require_once "DB.php";
$dsn ="odbc(acces s)://tcp()driver=Mic rosoft Access Driver
(*.mdb);dbq=C:\ \PrjData\\TestS cripts\\TestScr ipt.mdb";
$conn = DB::connect ($dsn);
if (DB::isError ($conn))
die ("Cannot connect: " . $conn->getMessage () . "\n");
$updateQuery="U PDATE Book1 SET SubCategory = ? WHERE ID = ?;";
$sth = $conn->prepare($updat eQuery);
if (PEAR::isError( $sth))
{
die($sth->getMessage() );
}
echo "<br> Prepare OK <br>";
$data = array('1','1');
//print_r($data);
$res1 =& $conn->execute($sth , $data);
if (PEAR::isError( $res1))
{
die($res1->getMessage() );
}
echo "Update OK <br>";
?>
Comment