Query an External Mdb

  • Thread starter Thread starter lesleyann76
  • Start date Start date
L

lesleyann76

Anyone know the syntax for a select query of a table outside of the
current db I am operating from.

For instance, let's say I am working out of SunsetForms.Mdb and am
writing a query to SunsetMainDB.Mdb file. How would I write that
query? And, do I need to establish some sort of permanent connection
to it upon an open event or something?

I get stumped after this attempt:

SELECT JobName
FROM Master_Jobs;

How would the query know where the "Master_Jobs" table is if it is
outside the the database which is running the query?

Thanks for any help you can give me.

Lesley.
 
You can create a linked table in SunsetForms.mdb (go through File | Get
External Data). You then query that linked table, and Access takes care of
the rest for you.

Alternatively, you can use

SELECT JobName
FROM Master_Jobs IN E:\Folder\SunsetMainDB.mdb;

or

SELECT JobName
FROM [;Database=E:\Folder\SunsetMainDB.mdb].Master_Jobs
 
You can create a linked table in SunsetForms.mdb (go through File | Get
External Data). You then query that linked table, and Access takes care of
the rest for you.

Alternatively, you can use

SELECT JobName
FROM Master_Jobs IN E:\Folder\SunsetMainDB.mdb;

or

SELECT JobName
FROM [;Database=E:\Folder\SunsetMainDB.mdb].Master_Jobs

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)


Anyone know the syntax for a select query of a table outside of the
current db I am operating from.
For instance, let's say I am working out of SunsetForms.Mdb and am
writing a query to SunsetMainDB.Mdb file. How would I write that
query? And, do I need to establish some sort of permanent connection
to it upon an open event or something?
I get stumped after this attempt:
SELECT JobName
FROM Master_Jobs;
How would the query know where the "Master_Jobs" table is if it is
outside the the database which is running the query?
Thanks for any help you can give me.

Great! I'll give that a try I did not know you could call the FROM
portion like that.

Thanks,
Lesley.
 
Back
Top