I created a VBA code which inserts data into my database via mysql on the server. My VBA code will be called by an C++ or C# executable. But if my VBA code fails, I want to restore a backup of my database. So I have some questions:
Is it possible to create a backup file of my db in VBA?
Is it possible to restore this backup file into my main db if my code fails?
If not, are there other approaches or suggestions to resolve this issue?
I haven’t worked with MySQL before but it supports transactions. You could do a rollback when your code fails and a commit when your code succeeds.