Today, my Access adventure was a common story you hear every once in a while and almost all of us have experienced.
I was finishing up some code it had taken me about an hour to write and I selected Debug->Compile from the VBE menu.
The little blue progress bar started a slower than usual march, and abruptly stopped a quarter of the way in and Access presented me with the Save dialog box to save a backup of my database.
I grabbed my head in disbelief and had the sinking feeling I get when I know I didn’t save since I had started working. That meant, no updated code in my versioning system and that meant it was all lost.
The new version of the database Access left me with didn’t even have the function I was working on in it any more, so I scrapped the whole thing. Then I took the backup copy I thought it had made and rewrote my changes. It did take less time now because I had just thought through it all and done it within the last hour. So I saved as I went and finished it off and fixed any compiler errors.
When I was finished though, the compiler had another error in a completely different module. Uh, that’s weird. And then another sinking feeling as I looked at the version of the backup I was working in and it had a version date in February 2024.
Argh! Fortunately I had just made changes to one module and put them all in the same section. It was a rewrite of a function anyway, so I just copied and pasted the updated section to Notepad for holding.
Thankfully, I had just uploaded a new version of the database from my laptop over the weekend, so I copied my development database from my laptop to my desktop and imported the other changes I had committed to get this database up to date. Finally, I copied in the new code and was able to save it, export it to my versioning software, and the database compiled fine this time.
Because I had recent backups and a version control system, this was not the disaster it could have been. I highly recommend having recent backups and versioning built into your development and deployment process for your customers!