How to Retrieve Data From Another Access Dataase Without Linking to It?

S

Stewart Berman

I would like to be able to pull data from another Access database without
linking to its tables. If I create a database object that references the
other Access database the only way I can seem to get data back is as a
recordset. But I cannot use a recordset as input to another query.

For example, if I want to extract data from a table in the other database
and append it to a table in the current database I would have to walk the
returned record set and copy each row into the target table.

With a true back end server I could use a back end query that returned a
recordset and use that query as input to an append query.

Obviously, that doesn't work with Access as there isn't a server to pass the
back end query to. What if the other database was opened in another
instance of Access -- could a back end query be made to work and if so how?
 
S

Stewart Berman

Marshall Barton said:
SQL allows for an IN phrase in the FROM clause. Eg.

SELECT . . .
FROM table IN "path\otherdb.mdb"

The IN phrase can be a full connection string that is the
same as the Connect property of a linked table's TableDef
object. For more information about IN see the SQL Reference
in Help.

The SQL Reference section is not terribly clear (except to say there is a
big performance hit) but it looks like it might work.

It may be adequate for what I am doing since performance is not an issue.
 

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