Vlad Chapranov
July 28th, 1999, 03:06 PM
What's wrong with this scenario?
In Form1_Load I open Access database db which may contain or not 2 queries Temp1 and Temp2 and Table TempTable, then in Command1_Click I delete all 3 objects (Temp1, Temp2, TempTable) if they exist with db.QueryDefs.Delete("Temp1"), db.QueryDefs.Delete("Temp2") and db.TableDefs.Delete("TempTable")otherwise 'On Error Resume Next'. After that I create and execute MakeTable query Temp1 with 'SELECT ... INTO' statement, which creates TempTable table. Second query is an append query which appends some records into the TempTable with 'INSERT INTO' statement. It works only with first click, with second it doesn't delete TempTable object, but appends some records into existing table. It looks like TempTable was not released after first action and it was not deleted. If I do not open it explicitly, how can I close it to allow deleting?
Thank you
Vlad
In Form1_Load I open Access database db which may contain or not 2 queries Temp1 and Temp2 and Table TempTable, then in Command1_Click I delete all 3 objects (Temp1, Temp2, TempTable) if they exist with db.QueryDefs.Delete("Temp1"), db.QueryDefs.Delete("Temp2") and db.TableDefs.Delete("TempTable")otherwise 'On Error Resume Next'. After that I create and execute MakeTable query Temp1 with 'SELECT ... INTO' statement, which creates TempTable table. Second query is an append query which appends some records into the TempTable with 'INSERT INTO' statement. It works only with first click, with second it doesn't delete TempTable object, but appends some records into existing table. It looks like TempTable was not released after first action and it was not deleted. If I do not open it explicitly, how can I close it to allow deleting?
Thank you
Vlad