php结合ACCESS的跨库查询功能_PHP

WBOY
Release: 2016-05-30 08:45:08
Original
801 people have browsed it

问题说明: 有时需要在两个或三个数据库的表中,通过相关关键字,查询获取所需记录集,用一般的SQL查询语句是实现不了的,可通过ACCESS的跨库查询功能实现。 

解决方法: 例如“装材类型”和“装材”两张表是在不同的数据库中的,具体查询方法,如下:

代码如下:


@"Select * from 装材类型 as a INNER JOIN [;database=" AppDomain.CurrentDomain.BaseDirectory "装材.zc].装材 as b ON a.BH=b.LXBH"

详细解释: [;database=path;pwd=12].A

ACCESS的跨库是通过中括号实现的,包括路径,密码设置等;跨库的前提是已经打开了一个Connection。

以上所述就是本文的全部内容了,希望大家能够喜欢。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template