PHP中通过ADO调用Access数据库
时间:2007-12-23 来源:不详 作者:迈克DB
<?php
include('tohtml.inc.php'); // load code common to adodb
include('adodb.inc.php'); // load code common to adodb
$db = &adonewconnection("ado_access");
print "<h1>connecting $db->databasetype...</h1>";
$access = 'test.mdb';
$mydsn = 'provider=microsoft.jet.oledb.4.0;'.'data source='. $access . ';';.'user id=;password=;'; if (@$db->pconnect($mydsn, "", "", "")) {
print "ado version=".$db->_connectionid->version."<br>"; dedecms.com
$sql = 'select name, group1 from experts';
$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".'<br>'.$db->errormsg();
?> 运行。
一切搞定!
文章评论
共有位Admini5网友发表了评论 查看完整内容