php adodb连接带密码access数据库实例,测试成功

2018-10-15 17:27

阅读:496

<?
//实例化db类,链接
$db=ADONewConnection(ado_access);
$access=realpath(./rs.mdb);
$myDSN=PROVIDER=Microsoft.Jet.OLEDB.4.0;.DATASOURCE=.$access.;.JetOLEDB:DatabasePassword=123456;;

$db->Connect($myDSN);
$recordSet=$db->Execute(select*fromtt);
if(!$recordSet)
print$db->ErrorMsg();
else
while(!$recordSet->EOF){
print$recordSet->fields[0]..$recordSet->fields[1].<BR>;
$recordSet->MoveNext();
}

$recordSet->Close();#选择性执行
$db->Close();#选择性执行
?>


评论


亲,登录后才可以留言!