Running queries in different DBs

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

Hi,
I'm supposed to create an Access application that will (at the click of a
button) launch different queries in different Access databases (in a well
defined order). Any help or an example would be welcome because I've never
had to program anything like this.
Thanks in advance
 
Dennis said:
I'm supposed to create an Access application that will (at the click of a
button) launch different queries in different Access databases (in a well
defined order). Any help or an example would be welcome because I've never
had to program anything like this.


That's too vague for an example. What does "launch" mean?
Generally, you need to use the data the query retrieves for
a form/report record source so users can view/edit the data.
Or, maybe you intend to open one or more recordsets and use
a VBA procedure to munge the different sets of data. OTOH,
you might want to run a sequence of SQL DDL statements to
modify table designs in the other databases.

Before you launch into a detailed explanation, If you need
to use SELECT queries, check Help - FROM Clause and
experiment to see if using the IN externaldatabase option
does what you need. If you need to do DDL statements, then
you probably should use OpenDatabase to open the other
databases and use the Execute method to run each query.
 
Hi,
A more detailed description of what I precisely need to do: There are a
couple (3) of existing Access DB's with their own queries and tables. What
I'm supposed to do, is execute these queries & copy some reports in the
different, existing DB's, from a new Access DB. What I've already done, is
writing a little VB code in each of the existing Access DB's that executes
the queries in order. Now I'm trying to launch this code from my new Access
DB. I'm having quite a lot of difficulty connecting to the other Access DB's
and accessing & executing the pieces of code (Public Functions) in them.

Thanks
 
That's different, but I am still not clear on what the other
dbs are doing when you call their procedure.

You can call a Public procedure in another database by
adding a reference to it (VBE window, Tools - References
menu item). But forms and reports may not use the tables
and queries you want them to use.

OTOH, you could try using Automation to open and manipulate
the other databases. Automation is a large subject so do
some research on the subject, try some simple things with
simple test databases and, if you have a problem with a
specific aspect, post a specific question to a new thread,
probably to a more appropriate newsgroup.
 
Back
Top