Importing External Tables

Steve R.

Retired
Local time
Today, 14:00
Joined
Jul 5, 2006
Messages
5,022
Is there a more efficient solution?
Code:
Zap ("OCRMQuestions")
strSQL = "INSERT INTO OCRMQuestions Select * FROM tblTemporary"
strSourceTableName = "OCRMQuestions"
DoCmd.TransferDatabase acImport, "Microsoft Access", strSourceDBSName, acTable, strSourceTableName, "tblTemporary"
DoCmd.RunSQL strSQL, dbFailOnError
DoCmd.DeleteObject acTable, "tblTemporary"

I am experimenting with how to import tables into a "developmental" database from my production database. The code copies from a table in the production database into a temporary table, then appends the data to the table OCRMQuestions, and then deletes the temporary table.

I was wondering if there was a way to directly import the data into the receiving table instead of using a temporary table?
 
Why not create linked table to the table in the other database? All you woudl need is an append query.

I am curious:
Is your database split? It should be.

Why not just make a copy of the production back end?
 
I had thought of linking the tables followed by transferring the data. In a sense linking would be a better solution since it skips the import and delete steps, so you are only left with the transfer data step. The more I think about it now, the better it seems.

Yes its split.

The reason I am not simply copying the production back end, is that I anticipate making significant structural changes to the database. The tables that I am importing, however, won't change. My programing tends to be do first, fix later. So, I am taking some time-out to reexamine the organization of the database.
 

Users who are viewing this thread

Back
Top Bottom