http://adodb.sourceforge.net/#download
本地下载 下载此文件
此文件解压后放到adodb目录里,最好是全部啊,不是只有ohtml.inc.php和adodb.inc.php
引用的确实只要这两个就可以了
复制代码 代码如下:
<?php
include('adodb/tohtml.inc.php'); // load code common to adodb
include('adodb/adodb.inc.php'); // load code common to adodb
$db = &adonewconnection("ado_access");
print "<h1>connecting $db->databasetype...</h1>";
$access = 'e:phpphpaccesstest.mdb';
$mydsn = 'provider=microsoft.jet.oledb.4.0;'.'data source='. $access.';user id=;password=;';
//注意了,mdb地址是物理地址啊
if (@$db->pconnect($mydsn, "", "", "")) {
print "ado version=".$db->_connectionid->version.";
";
$sql = 'select thename from news';
$rs = $db->execute($sql);
rs2html($rs,'border=2 cellpadding=3',array('customer name','customer id'));
} else print "error: access test requires a access database $access".';
'.$db->errormsg();
?>
数据库呢,普通的access数据库,和正常的一样,不需注意什么
测试通过。如果有更好的建议请,请在评论里指出
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!