Re: Union data from two databases

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: John Viescas (JohnV_at_nomail.please)
Date: 03/11/04


Date: Thu, 11 Mar 2004 17:14:53 -0600

Close. I find it's easiest to link the table and then look at the Connect
property of the linked TableDef. Try this IN clause:

IN "" [MS Access;PWD=joven1;DATABASE=C:\MyDatabases\ArchivedHistory.mdb]

-- 
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
"Steven" <anonymous@discussions.microsoft.com> wrote in message
news:b62901c4078f$30ca2b50$a101280a@phx.gbl...
> Thank you for the response.  And if the history database
> has a password then I can just pass the password in the
> sql statement with the
> IN "C:\MyDatabases\ArchivedHistory.mdb ; PWD=joven1"
> or something like that.
>
> Thanks.
>
> Steven
>
>
>
> >-----Original Message-----
> >Steven-
> >
> >A simple way is to use the IN clause directly in the SQL:
> >
> >SELECT *
> >FROM tblClientHistory
> >WHERE ClientID = 555
> >UNION
> >SELECT *
> >FROM tblClientHistory
> >IN "C:\MyDatabases\ArchivedHistory.mdb"
> >WHERE ClientID = 555
> >
> >-- 
> >John Viescas, author
> >"Microsoft Office Access 2003 Inside Out"
> >"Running Microsoft Access 2000"
> >"SQL Queries for Mere Mortals"
> >http://www.viescas.com/
> >(Microsoft Access MVP since 1993)
> >"Steven" <anonymous@discussions.microsoft.com> wrote in
> message
> >news:836501c40785$6a9c75e0$a601280a@phx.gbl...
> >> I have too many records in my database and want to store
> >> some of the history in a second database.  I want to be
> >> able to access the data in the history database and
> query
> >> on certain criteria like ClientId = "?????" and Union
> this
> >> with the current data from the main table in the current
> >> database.  I have a little experience with workspaces,
> if
> >> that is what you use, but I do not see how to union data
> >> from different databases and create a recordset to use
> as
> >> a controlsource for a form or report.
> >>
> >> Thank you for your help.
> >>
> >> Steven
> >
> >
> >.
> >


Relevant Pages

  • Re: Query referencing dialog box
    ... "Running Microsoft Access 2000" ... > "John Viescas" wrote in message ... >> "SQL Queries for Mere Mortals" ...
    (microsoft.public.access.queries)
  • Re: Cycle Through two Tables
    ... "Running Microsoft Access 2000" ... >>John Viescas, author ... >>"SQL Queries for Mere Mortals" ... >>> richard ...
    (microsoft.public.access.queries)
  • Re: Selecting records using autonumber as key
    ... John Viescas, author ... "Running Microsoft Access 2000" ... "SQL Queries for Mere Mortals" ... > record using an autonumber key number, ...
    (microsoft.public.access.queries)
  • Re: Access 2002 command line options.
    ... > database Opens the specified database. ... > /excl Opens the specified database for exclusive access. ... > /user user name Starts Microsoft Access using the specified user name. ... To compact to a different name, specify a target ...
    (microsoft.public.access.developers.toolkitode)
  • Re: Cant access code
    ... See http://www.QBuilt.com for all your database needs. ... See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials. ... Create a new database file and import all objects except the corrupt form. ... If you have a recent backup, import this form from the backup and check ...
    (microsoft.public.access.modulesdaovba)