php代码:
<?php
$connstr="DRIVER=Microsoft Access Driver (*.mdb);
DBQ=".realpath("mydb.mdb");
$connid=odbc_connect($connstr,"","",SQL_CUR_USE_ODBC ); $query=odbc_do($connid,"select * from data");
//$query= odbc_do($con,$sql);
while(odbc_fetch_row($query))
{
for($i=0;$i<4;$i++)
{
echo $record1[$i] = odbc_result($query,$i+1);
echo " ";
}
echo "<br>";
} ?>
access数据库名为mydb.mdb,里面有一个数据表data