/*
创建ADO连接
*/
$conn=@newCOM("ADODB.Connection")ordie("ADOConnectionfaild.");
$connstr="DRIVER={MicrosoftAccessDriver(*.mdb)};DBQ=".realpath("DATUM/cnbt.mdb");
$conn->Open($connstr);
/*
创建记录集查询
*/
$rs=@newCOM("ADODB.RecordSet");
$rs->Open("select*fromdbo_dirs",$conn,1,3);
/*
循环读取数据
*/
while(!$rs->eof){
echo"$rs->Fields["title"]->Value;
echo"
";
$rs->Movenext();//将记录集指针下移
}
$rs->close();
?>