Access: SQL statement across database queries

xiaoxiao2021-03-06  83

By Ben

Problem Description:

Sometimes in the table of two or three databases, through the related keywords, queries to obtain the desired recordset, with a general SQL query statement is not implemented, and can be implemented through Access's cross-library query function.

Solution:

For example, "Mage Type" and "Mount" two tables are in different databases, specific query methods, as follows:

@ "SELECT * FROM machine type as a inner join [; database =" appdomain.currentdomain.basedirectory "Machine .ZC]. Mount AS B on A.BH = B.LXBH"

Detailed explanation:

[; Database = path; PWD = 12] .a

Access's cross-library is implemented by brackets, including path, password setting, etc .; cross-library premise is already opened a connection.

转载请注明原文地址:https://www.9cbs.com/read-108509.html

New Post(0)