D
deko
I have an Access 2003 mdb with code that helps users import data from Excel.
Oftentimes the Excel spreadsheets contain a variable number of superfluous
columns. So I want to import everything into a Temp table, then
automatically drop all columns EXCEPT the ones that are needed (rather than
making the user do this manually when importing the spreadsheet).
I need to run something like this against the Temp table:
[pseudo code]
ALTER TABLE [DB1489_CLAIMS2007Q4] DROP COLUMN * WHERE (COLUMN Not In
("MyCol1", "MyCol2", "MyCol3", "MyCol4", "MyCol5", "MyCol6", "MyCol7",
"MyCol8"));
Is it possible to do this? If so, what is the correct syntax?
The thing is I need to preserve the name of the Temp table for use with
other code. Could I define a Make Table Query (qryMTQ), drop the original
Temp table, refresh TableDefs, then run qryMTQ to recreate the original Temp
table with the same name and only the required fields: "SELECT INTO
DB1489_CLAIMS2007Q4 ... " (?)
Other options?
Thanks in advance.
Oftentimes the Excel spreadsheets contain a variable number of superfluous
columns. So I want to import everything into a Temp table, then
automatically drop all columns EXCEPT the ones that are needed (rather than
making the user do this manually when importing the spreadsheet).
I need to run something like this against the Temp table:
[pseudo code]
ALTER TABLE [DB1489_CLAIMS2007Q4] DROP COLUMN * WHERE (COLUMN Not In
("MyCol1", "MyCol2", "MyCol3", "MyCol4", "MyCol5", "MyCol6", "MyCol7",
"MyCol8"));
Is it possible to do this? If so, what is the correct syntax?
The thing is I need to preserve the name of the Temp table for use with
other code. Could I define a Make Table Query (qryMTQ), drop the original
Temp table, refresh TableDefs, then run qryMTQ to recreate the original Temp
table with the same name and only the required fields: "SELECT INTO
DB1489_CLAIMS2007Q4 ... " (?)
Other options?
Thanks in advance.