当前位置: 移动技术网 > IT编程>开发语言>PHP > PHP中通过ADODB库实现调用Access数据库之修正版本 原创

PHP中通过ADODB库实现调用Access数据库之修正版本 原创

2019年06月08日  | 移动技术网IT编程  | 我要评论
最主要的下载地址了,请先看上一篇文章。


本地下载下载文件
此文件解压后放到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:\php\phpaccess\test.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数据库,和正常的一样,不需注意什么
测试通过。如果有更好的建议请,请在评论里指出

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网