The instructions for removing MAX Database corruption seem pretty daunting and it would be much easier if there was a tool to automate the process. This VI does just that!
If you would like to know what is done to your computer by running this tool, check out Knowledgebase 4GA9TOQA: What is the Process For Removing MAX Database Corruption? MAX Database corruptions are rare, but may be caused when a system reboots without being properly shut down due to a power loss or a sytem crash. One sign that your database may be corrupt is if you click on the plus sign for a folder in MAX and if instead of expanding, the plus sign disappears. If this error occurs after installing a newer version of MAX, verify that you have already performed a reboot of your PC before proceeding.
Steps to Complete
This utility is provided in two different forms:
If you already have LabVIEW and/or the LabVIEW RunTime Engine installed, use the executable to remove database corruption by following the prompts. If you do not have either, please download the LabVIEW 2009 RunTime Engine here.
This consists of the LabVIEW project and associated VIs that are necessary to run the main application. If you are curious about exactly how this works, this is the place to look.
Step by Step Guide:
Ensure that NI Measurement & Automation Explorer (MAX) and LabVIEW are not running.
Run Max Corruption Removal.exe OR run the Remove MAX Database Corruption VI in the source code.
After the main screen appears read the description and disclaimer then click Start.
A new window will appear prompting for where to save a backup of your Last folder. Navigate to your desired folder and click Current Folder
A similar window will appear asking for where to save a backup of your Data folder. Navigate to the same folder as above and click Current Folder
The next window will display the date and time of your current backup. If that file is from a date and time when MAX worked correctly, click Yes. If MAX was still corrupt at that time or if you want to start from a completely new MAX database, click No.
There will be a series of promptings asking if you want to confirm the deletion of one or many of various files or folders. For all of these click OK.
The final window will say that the MAX database corruption removal tool is complete. Click OK and reboot your computer.
This procedure can result in loss of data. If you have custom scales you would like to back up before attempting this repair, visit ni.com and follow the steps listed in KnowledgeBase 4XQAJPBQ.
This program may have to delete the Data folder in its entirety in order to remove database corruptions. All configuration settings will be lost. The next time MAX is launched, you will have to reconfigure all of your hardware again.
-Updated Code to State Machine Architecture
-Implemented Additional Error Handling
-Added ability to restart services and hopefully avoid reboots
-Made Stopping and Starting of Services scaleable for easy addition of new dependent services