$conn = new com("ADODB.Connection");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("www.111com.net/db.mdb");
//与access连接要用到com接口了。
$conn->Open($connstr);
$rs = new com("ADODB.RecordSet");
//数据查询并显示出来
$rs->Open("select * from szd_t",$conn,1,1);
while(! $rs->eof) {
$f = $rs->Fields(1);
echo $f->value;
$rs->MoveNext();
}
//下面来看一下php access数据库教程保存
$sql ="insert into szd_t(title)values('www.111com.net')";
$rs->Open( $sql );
echo '保存成功';
//php access数据库编辑
$sql ="Update szd_t set title='111com.net' where id=".$_GET['id'];
$rs->Open( $sql );
echo '编辑成功';
//删除数据
$sql ="delete from szd_t where id=".$_GET['id'];
//本文章原创于www.111com.net,转载注明出处