Empty and re-fill a table within a transaction

DataMiner

Registered User.
Local time
Today, 02:41
Joined
Jul 26, 2001
Messages
336
Quite often I have the need to do something like the following, to refresh data in a table:

currentdb.execute "delete * from MyTable",dbfailonerror
docmd.transfertext acimportdelim "MyImportSpec","MyTable","MyTextFile",true

I would very much like to enclose these two lines within a transaction, so that if the transfertext action fails, the records don't get deleted from MyTable. However, when I try to use a transaction here I get an error on the transfertext action:
Error # 3008-- "The table 'MyTable' is already opened exclusively by another user..."

How can I handle this?

Thanks for any suggestions.
 

Users who are viewing this thread

Back
Top Bottom