Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

Importing from different database

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KarenH - 08 Nov 2005 22:10 GMT
I hope this is the right forum for this question.   I am working in an Access
database and need to import data from another database, and that data is from
the result of running a stored query, rather than a table.  That data, in
turn, is being used to populate a table in the current database.  

I thought I could just do a transferdatabase, but when I did, I discovered
the query from database #2  is based on the results from ANOTHER query from
database #2.  So I think I would need to to a transferdatabase for both
queries.

Is there a more efficient way to do this?  
David Lloyd - 09 Nov 2005 03:53 GMT
Karen:

I am assuming that your "other" database is also an Access database.  If so,
Access supports the IN SQL clause that allows you to specify a table or
query in a remote ("other") database.  For example:

INSERT INTO MyNewTable
SELECT *
FROM RemoteQuery IN 'C:\db2.mdb';

Signature

David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.

I hope this is the right forum for this question.   I am working in an
Access
database and need to import data from another database, and that data is
from
the result of running a stored query, rather than a table.  That data, in
turn, is being used to populate a table in the current database.

I thought I could just do a transferdatabase, but when I did, I discovered
the query from database #2  is based on the results from ANOTHER query from
database #2.  So I think I would need to to a transferdatabase for both
queries.

Is there a more efficient way to do this?
KarenH - 09 Nov 2005 20:46 GMT
Tried that, but I got an "Syntax error in query.  Incomplete query clause."
error.  The table was created and named, and the SQL clause was "INSERT INTO
TEMPnewtable SELECT * FROM 'MyRemoteQueryName' in
'C:\Location\RemoteTableName.mdb'

> Karen:
>
[quoted text clipped - 19 lines]
>
> Is there a more efficient way to do this?
David Lloyd - 09 Nov 2005 21:33 GMT
Karen:

It looks like you put single quotes around the name of the query
('MyRemoteQueryName' ) which aren't necessary.

Signature

David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.

Tried that, but I got an "Syntax error in query.  Incomplete query clause."
error.  The table was created and named, and the SQL clause was "INSERT INTO
TEMPnewtable SELECT * FROM 'MyRemoteQueryName' in
'C:\Location\RemoteTableName.mdb'

"David Lloyd" wrote:

> Karen:
>
[quoted text clipped - 21 lines]
>
> Is there a more efficient way to do this?
KarenH - 10 Nov 2005 00:34 GMT
Thanks, I didn't know that!  Unfortunately, I still got the error about not
being able to find one of the queries that were used as the source of the one
I was after.   The only solution I could see was to run a "make table" query
from it in the remote database and then get the table by importing it into
the current database.  If I could figure out how to execute this "make table"
query on the remote side while I was running the current database, I would be
all set.  

Is there any way of knowing this that you know of?  

> Karen:
>
[quoted text clipped - 33 lines]
> >
> > Is there a more efficient way to do this?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.