PHP中通过COM访问Access数据库(简易示例)
时间:2006-05-18 来源:manbuzhe0301
[url=file:///C:/Documents%20and%20Settings/admin/My%20Documents/db1.mdb][/url]
Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("db1.mdb"));
$rs = $conn->Execute("SELECT * FROM table1"); // Recordset
$num_columns = $rs->Fields->Count();
//echo $num_columns . "
";
for ($i=0; $i Fields($i);
}
$rowcount = 0;
while (!$rs->EOF) {
for ($i=0; $i value . " ";
}
echo "
";
$rowcount++; // increments rowcount
$rs->MoveNext();
}
$rs->Close();
$conn->Close();
$rs = null;
$conn = null;[/url]
?>
相关阅读 更多 +