Import and export data (1 Viewer)

wgma

Registered User.
Local time
Today, 04:41
Joined
Nov 19, 2007
Messages
72
I have 2 access databases that I need to share data between. In DB1 I need to export data. I have created a query that will get me the data that I need to export. Is there a way to do this automatically like in SQL Server's DTS packages or can I create a button that will fire off the export process?

In DB2 I need to import that data. I have the same question as above, can I do it through an automated process or button click?

How do I do either of these tasks.

Thanks.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:41
Joined
Feb 19, 2002
Messages
42,970
Rather than exporting/importing, why not have one db link to the tables in the other?
 

wgma

Registered User.
Local time
Today, 04:41
Joined
Nov 19, 2007
Messages
72
Rather than exporting/importing, why not have one db link to the tables in the other?

The databases will not be on the same network.
 

odin1701

Registered User.
Local time
Today, 03:41
Joined
Dec 6, 2006
Messages
526
Look up the help on this:

DoCmd.TransferSpreadsheet

You can code this so it will export a spreadsheet of the data from DB1 - just use the query you made as the source. You can specify the file location where to put it or have the user choose by using a dialog box, but that is more involved. In DB2 you can just do the same code, but import from the same file. For the import, the field names need to be identical to the table if you are importing to a table - if not you will need to import the file into a temporary table, and use an append query to get your data to the right spot in DB2.
 

Users who are viewing this thread

Top Bottom