View Full Version : Connect to multiple database files with query


Ant59
10-18-2008, 03:14 AM
How can I write my query, so that it will search through all of the .mdb files in one diretory?

So far, I have:

SELECT JOB.JobName AS JobName
FROM [;database=\\Maple\*.mdb].JOB


Maple is the server name, and I want to connect to all .mdb files in the root of Maple, then search through them to see if they match my query's criteria. Could someone help me please?

Guus2005
10-19-2008, 11:51 AM
The syntax i slightly different and it can't be done in a single query.
Select Job.name as jobname from job in "\\Maple\first.mdb"
You have to loop through all mdb files on that directory and execute the query.

But if you want to have the result of all the job.names in all job databases in all directories, then you have to concatenate all queries to a single query using the UNION sql statement.

HTH:D

Ant59
10-21-2008, 08:57 AM
Thank you.