A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old April 14th, 2010, 05:19 PM posted to microsoft.public.access.queries
Stewart Berman
external usenet poster
 
Posts: 68
Default How to Retrieve Data From Another Access Dataase Without Linking to It?

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?
  #2  
Old April 14th, 2010, 06:03 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default How to Retrieve Data From Another Access Dataase Without Linking to It?

Stewart Berman wrote:

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?


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.

--
Marsh
MVP [MS Access]
  #3  
Old April 20th, 2010, 04:52 AM posted to microsoft.public.access.queries
Stewart Berman
external usenet poster
 
Posts: 68
Default How to Retrieve Data From Another Access Dataase Without Linking to It?

Marshall Barton wrote:

Stewart Berman wrote:

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?


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.
  #4  
Old April 20th, 2010, 05:28 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default How to Retrieve Data From Another Access Dataase Without Linking to It?

Stewart Berman wrote:

Marshall Barton wrote:

Stewart Berman wrote:

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?


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.



I have not had an issue with performance, but I don't
connect to anything other than Access and Excel files. If
you have trouble figuring out what the connect string should
be, manually link to a table, and then use the Immediate
Window to see what Access did:
?CurrentDb.TableDefs!thelinkedtable.Connect

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.