贴心猫(IntimateCat) pdo连接access (提示) 用于导数据
require(dirname(__DIR__).'/root/run/_init.php');
$dbfile = 'ysWeb_0BA8C730-7777-8888-9999-12345678.xxxDB';
$dbfile = dirname(dirname(__DIR__)).'/2017/upfile/#dbf#/'.$dbfile;
// 数据库 - 使用pdo连接access
$_cfgs['db_class'] = 'pdox'; // 数据库类(class),mysqli(推荐),pdox(用于PDO扩展),mysql
$_cfgs['db_dsn'] = 'odbc:driver={microsoft access driver (*.mdb)};dbq='.$dbfile;
//$_cfgs['db_type'] = 'access';
$cfgs = glbDBObj::getCfg();
$cfga = array_merge($cfgs,$_cfgs);
$dba = db($cfga);
$sql = "SELECT * FROM InfoPics";
$rs = $dba->query($sql);
$rs = comConvert::autoCSet($rs,'gbk','utf-8');
dump($rs);
$db = new PDO("odbc:driver={microsoft access driver (*.mdb)};dbq=".realpath("access.mdb")) or die("Connect Error");
$rs = $db->query('select * from web');
print_r($rs->fetchAll());