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.
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.