Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why can I not delete a temporary table?

Status
Not open for further replies.

MoonMullen

Programmer
Jun 13, 2001
25
US
I am using Access 2000 on a Win2000 PC. I am loading new data from a text file. I create a temporary table to hold the new data. I append the temp table to a permanent table within the same database. I want to now "clean up" and delete any queries and temporary tables. I can delete the queries, however I receive a run-time error when I attempt to delete the temporary table. I can not delete it!. Why? What am I doing wrong? Could it be that after I append the data, I need to close the temporary table?!? [glasses]
 
How are you adding data to the main table from the temporary one? Do you have recordset objects open that should be closed or do you use insert queries to copy the data?
Are you using the DAO Tabledefs("tablename").Delete syntax or SQL "DROP TABLE abcd;"

Can you delete the table manually from the database window?
John
 
If you're using the same format for importing every time, just leave the table definition and do a "DELETE * FROM temptable_name". There are some benefits from leaving it in existence:
-queries that use the temp table mess up the query-builder view unless the table exists
-it takes very little to no space to just have the table definition (NOTE: no space AFTER a compact)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top