php连接access数据库的示例代码:
<?php
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=".realpath("C:\Program Files\Att2008\att2000.mdb");
$conn = odbc_connect($connstr, "", "", SQL_CUR_USE_ODBC);
$issuetime = date("Y-m-d H:i:s");
$sql = "select * from CHECKINOUT where USERID=2";
$query = odbc_exec($conn, $sql);
while ($row = odbc_fetch_array($query)) {
$dt = $row["USERID"];
$checktime = $row["CHECKTIME"];
if($checktime < "2011-5-18 13:35:02") {
echo $checktime;
}
}
?>