Running Queries in Another Access DB

R

ricky

Hi

I have an application (MDB1) which sources data from another Access DB
(MDB2) and I was wondering if it is possible to execute a 'Make-Table' query
located in MDB2 through VBA code in MDB1?

Kind regards

Ricky
 
M

Michel Walsh

You can definitively *link* the table from MDB2 into MDB1 and run SQL
statements on the linked tables (that is, probably, using MDB2 tables, not
MDB1 ones). That is what occurs in a front-end/back-end application, where
MDB1 would be the front end and MDB2 the back end.

You can also Import the query, through File | Get External Data | Import...


Hoping it may help,
Vanderghast, Access MVP
 
G

Guest

Hi Ricky

You could use a macro in the other DB (MDB2) to run the querry - start the
macro from MDB1

Use Run app macro in MDB1

"C:\Program Files\Microsoft Office\OFFICE11\ MSACCESS.EXE " "C:\MyDocuments\
MDB2.mdb " /X SomeMacroName


Or call a shell from MDB1

Call Shell("""C:\Program Files\Microsoft office\OFFICE11\MSACCESS.EXE""
""C:\MyDocuments\MDB2.mdb""/X SomeMacroName", 1)


Hope this helps
 
R

ricky

Hey Wayne

Thanks for the tip, will try the macro method.

Thanks and kind regards

Ricky
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top