Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I investigate and resolve an (apparent) Access database corruption?

I have an Microsoft Access 2010 database application with split front end and backend which has started to behave oddly, and I've exhausted all the options I know for investigating and resolving the problem.

32-bit Access 2010 running on Windows 8.1... I have both Access 2010 and Access 2013 installed, but the problem also manifests itself on a Windows 8.1 system with a completely fresh install of Access 2010 and no Office 2013 present. The issue also exists if the application is run using Access 2010 Runtime. The front-end is running on my hard disk, not in a Dropbox or similar environment. The back-end is in Dropbox.

There are a couple of third-party elements in the application -- references are as shown -- example 1 on the system with both Access 2010 and 2013 present, example 2 on the system with just Access 2010 present.

Enter image description here

Enter image description here

There hasn't been a software update to the Treeview control since December 2013. I've checked that the versions of the third-party controls I'm using are compatible with Windows 8.1.

Symptoms:

The application (an unreleased development version) initially works perfectly, but if closed and reopened, one specific operation (right-click on a third party treeview ActiveX control on the main form) misbehaves -- the right-click event is triggered multiple times instead of just once (the number of times is unpredictable). There are two treeviews on the main form with identical settings (populated dynamically with different data sets). One treeview behaves, one doesn't. Even if I remove all code from the right-click event, it fires twice.

This main form configuration and code hasn't been changed in over one year, not has the treeview config or code. I don't use Compact on Close. The application isn't logging any errors.

What I've tried:

If I restore a previous version of the application, it works... and when reopened, doesn't work. (I've tried this with several previous versions of the database.)

I've tried importing a copy of the main form from an old working version of the database -- same problem.

I've tried deleting the malfunctioning treeview and creating a new one (copying the one that is working) -- same problem.

I've tried creating a new blank database and importing all the objects from the old one. Once I've restored the references manually, the same problem.

I've reviewed all the possibilities mentioned in Can't eliminate Access corruption -- one commonality I have with this question is that I've (last three months) started using the VBA Implements keyword, but I hadn't made any changes to this code immediately before the problem showed up, and neither the main form nor the treeview control utilise it.

I've emailed the support team for the treeview control, but they haven't anything to suggest that I haven't already tried.

I've repaired the installation of both Access 2010 and Office 365 in case the references were somehow messed up.

I've un-installed Office 365 and Access 2010, rebooted the machine and reinstalled Access 2010. The references are all Office 14 references and the problem still exists (in a compiled accde). As soon as I reinstall Office 365, the references become mixed 14 and 15. (This is also true for the working version which is two years old).

What I haven't tried yet:

Rolling back a two months' worth of Windows updates to see if it's a Windows issue (this system has only been in use since early September, so this wouldn't be hugely onerous to try).

Rolling back to a version of the app from December 2012 (the last production release) which doesn't seem to have suffered the corruption and manually reapply almost two years worth of development changes. This would be a mega undertaking....

Are there any other options for investigation or resolution that I can try?

Edited to add: What finally worked

I created a new empty database, imported everything from the old database except the main form, which I recreated from scratch to look identical and have the same code as the old one... And the problem has gone away. It not very satisfactory as a resolution, but it seems to confirm that there was a corruption somewhere.

like image 847
ColeValleyGirl Avatar asked Oct 17 '14 16:10

ColeValleyGirl


People also ask

How do I fix a corrupted Access database?

Select File > Info > Compact & Repair Database. Access creates a copy of the compacted and repaired database in the same location.

What Access tool can you use to find and fix corrupt data within a database?

DataNumen Access Repair is the best MS Access repair and recovery tool in the world. It can repair the corrupt Access . mdb and . accdb databases and recover as much of your data as possible, thereby minimizing the loss in file corruption.

How do I know if my Access database is corrupted?

Corruption errors are usually uncovered when performing functions: such as deleting records, accessing the database and its objects or its data. For example, you may receive an error message when opening and closing databases, running reports, forms or queries, updating records and/or scrolling through data records.


2 Answers

One of the best ways to remove corruption in an Access database is to save the forms and reports to text using the undocumented SaveAsText function, delete the form and report objects, close the database, use the undocumented /decompile switch to decompile the database, compact/repair the database, then re-import all the objects using the undocumented LoadFromText function.

like image 159
mwolfe02 Avatar answered Nov 15 '22 08:11

mwolfe02


Usually the Access databases corruptions affect the VBA modules, less likely the table data. So hopefully you should be able to copy the data to a blank database, get the VBA code from a older backup (since the last source code update) and merging the two together. It should work!

like image 41
Cookie Monster Avatar answered Nov 15 '22 06:11

Cookie Monster