Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Select Data using SQL from another mdb

Hi,

I've developed an access db which "archives" all existing data to a new db
for each financial year.

This works fine, however, I now need to use the orignal, cleared db to access
the data in the tables of the external archive db.

It should work seemlessly, as if the tables are actually in the current db.

I would really prefer it if I could use a SQL statement in the rowsource
of combo boxes and reports to access this data.

Is this possible?

If so, how? or if not... what would be the best solution?
[576 byte] By [R144N] at [2007-11-10 12:23:01]
# 1 Re: Select Data using SQL from another mdb
On 9 Feb 2003 12:58:48 -0800, "R144N" <R144N@msn.com> wrote:

Hi,

I've developed an access db which "archives" all existing data to a new db
for each financial year.

This works fine, however, I now need to use the orignal, cleared db to access
the data in the tables of the external archive db.

It should work seemlessly, as if the tables are actually in the current db.

I would really prefer it if I could use a SQL statement in the rowsource
of combo boxes and reports to access this data.

Is this possible?

If so, how? or if not... what would be the best solution?

You can create static table links to the archive database in your original, or use SQL statements
such as the following:

strSQL = "SELECT * INTO [MS Access;DATABASE=D:\My Documents\db10.mdb;].[TableCopy] FROM Table1 WHERE
[record ID] IS Null"

Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)
Paul Clement at 2007-11-11 17:46:18 >
# 2 Re: Select Data using SQL from another mdb
WORKS LIKE A DREAM! THANX! - R144N
R144N at 2007-11-11 17:47:19 >