J
John
I have an Access 2002 db where I need to update tables either from external
data (Excel spreadsheets) or from other tables/queries in the db. It seems
to make sense to use temporary tables as an intermediate step. However, I am
self-taught, so I am not sure what the "proper" approach to using temporary
tables is. Listed below are the strategies I can think of or have seen
suggested. I have been using the first two (mostly the first one), and have
issues with data type conversion (with external data) and database bloating,
so I am trying to learn better ways. Can anyone tell me about the advantages
/ disadvantages of these strategies, or what is considered good development
practice? Are there other better strategies I am missing?
1) Use a make table query (or DoCmd.TransferSpreadsheet for external data)
to create a new temporary table. Work with data from the new temporary
table, then delete it when done.
2) Create a temporary table from code, then use an append query (or
DoCmd.TransferSpreadsheet for external data) to append data to the temp
table. Work with data from the new temporary table, then delete it when done.
3) Create a permanent "temporary" table in the database. Delete any data
from the table, then use an append query (or DoCmd.TransferSpreadsheet for
external data) to append data to the "temp" table. Work with data from the
"temp" table, then delete the data when done, leaving the table structure.
4) Create a temporary mdb file and import the data to a table in the temp
db. Link to the table in the temp db from the main db. Work with data from
the linked table, then delete the temp mdb file (and possibly the linked
table) when done.
Thanks,
John
data (Excel spreadsheets) or from other tables/queries in the db. It seems
to make sense to use temporary tables as an intermediate step. However, I am
self-taught, so I am not sure what the "proper" approach to using temporary
tables is. Listed below are the strategies I can think of or have seen
suggested. I have been using the first two (mostly the first one), and have
issues with data type conversion (with external data) and database bloating,
so I am trying to learn better ways. Can anyone tell me about the advantages
/ disadvantages of these strategies, or what is considered good development
practice? Are there other better strategies I am missing?
1) Use a make table query (or DoCmd.TransferSpreadsheet for external data)
to create a new temporary table. Work with data from the new temporary
table, then delete it when done.
2) Create a temporary table from code, then use an append query (or
DoCmd.TransferSpreadsheet for external data) to append data to the temp
table. Work with data from the new temporary table, then delete it when done.
3) Create a permanent "temporary" table in the database. Delete any data
from the table, then use an append query (or DoCmd.TransferSpreadsheet for
external data) to append data to the "temp" table. Work with data from the
"temp" table, then delete the data when done, leaving the table structure.
4) Create a temporary mdb file and import the data to a table in the temp
db. Link to the table in the temp db from the main db. Work with data from
the linked table, then delete the temp mdb file (and possibly the linked
table) when done.
Thanks,
John