I am an experienced computer troubleshooter, but this latest problem has me scratching my head a bit since the most obvious troubleshooting solutions don't seem to be yielding any kind of positive results for me. As a result, I would like to present my case to the Microsoft Answers community to see if any of you can provide me with some helpful suggestions or insight. I have a Compaq Evo N620c laptop with Microsoft Windows XP Professional SP3 32-bit installed on it. It has worked flawlessly for years and up until now it hasn't given me any trouble. After working perfectly fine the day before, when I powered it on one morning it failed to boot into Windows with the following error message on a black screen:
Windows could not start because the following file is missing or corrupt:
\WINDOWS\AppPatch\drvmain.sdb
You can attempt to repair this file by starting Windows Setup using the original Setup CD-ROM.
Select 'r' at the first screen to start repair.
This problem occurs when the laptop begins to boot Windows XP no matter which boot option that I choose from the F8 boot menu-- whether I choose to have Windows boot normally, boot into "Safe Mode," use the "Last Known Good Configuration," etc., the booting always halts after just a couple of seconds at a black screen with the error message that I listed above. This means that I cannot boot Windows at all, including into "Safe Mode."
There is no obvious cause for why the laptop started to have this problem all of a sudden. I have not added or changed any hardware on the laptop in the past few years, let alone right before I started experiencing the problem. I did install two small pieces of software onto the laptop before it was last shutdown, but it was nothing major-- an update to the Avast! anti-virus scanner's malware definition files, and an upgrade to the DivX video player. I checked the Avast! AV scanner's support forum to see if the new virus definitions that I recently installed could have been the cause of my current woes, but I did not see any posts there that came anywhere close to resembling my problem. I wish that I could say the same for DivX video player website, but their support forums are currently "under construction." However, I saw no posts made to their website's primary blog or their "Labs" blog announcing any problems that any of their recent software updates had caused, for what that's worth. The laptop was not dropped, jolted, or physically mis-handled in any way. The laptop did not suffer through any sort of power surges or brown outs. In fact, the outlet that the laptop was plugged into was surge-protected, power-conditioned, and battery backed by a UPS. Combine that with the fact that the laptop also has its own built in battery protecting it from power loss, and I think that it is safe to come to the conclusion that power fluctuations were very unlikely to be the cause of my current problem. To make sure that my problem wasn't being caused by failing RAM, I ran Memtest86+ on the laptop for 36-straight hours, and it went through 29-complete passes of the testing suite without generating a single error.
I have read in other forums online that sometimes these kinds of boot errors are caused by failing hard disks, so I also looked into that possibility as follows:
The first thing that I tried was to boot the laptop from a Windows XP installation CD-ROM and enter the Windows XP Recovery Console, and then run "chkdsk /r" on the hard disk to check the integrity of the disk's NTFS file system. The very first run through of chkdsk did report that it found an error with the file system and corrected it, but unfortunately the Recovery Console version of the chkdsk utility seems to be criminally sparse with its output, as it didn't tell me what kind of file system problem that it fixed, how many errors that it fixed, etc., leaving me completely in the dark as to what it found that was wrong. For all I know the problem that it found could have been something that was relatively benign, or it could have been something serious. I have know way of knowing. What I can tell you however is that chkdsk was able to fix whatever the file system problem was after only a single pass-- I have probably run "chkdsk /r" at least 5 more times on the hard disk since then, and the disk has passed all of these additional checks with flying colors every time. I also took my hard disk investigation a bit further by checking the hard disk's S.M.A.R.T. data and running the S.M.A.R.T. short and extended hard disk self-tests. The S.M.A.R.T. data showed that the hard disk had no errors in its error log, and the hard disk passed two "short" self-tests and one "extended" self-test without error. The S.M.A.R.T. data also showed that the hard disk has only been in operation for a few hundred hours, so it is by no means a well-worn hard disk or anything like that. Lastly, I booted the laptop using a "Parted Magic" Live CD, and was able to successfully mount the hard disk and browse all of the laptop's files. So while all of this can't absolutely rule out all possibility of there being a problem with the hard disk, I would say that it still does make a very strong case that the hard disk installed in the laptop is just fine, and that the cause of the Windows XP booting problem lies elsewhere.
The next step that I took to attempt to resolve this error was the obvious one-- since the Windows boot process was reporting that the "\WINDOWS\AppPatch\drvmain.sdb" file was either missing or corrupted, I then checked to see if that file was indeed missing or corrupted. A quick look in the "C:\WINDOWS\AppPatch" directory showed that the drvmain.sdb file was indeed there, so it definitely wasn't missing. I renamed the drvmain.sdb file in that directory to "drvmain.old" so that I still had the original file if I ended up needing it, and then proceeded to find a replacement copy of the file elsewhere within the file system. I found several copies of the drvmain.sdb file in various directories on the computer's hard disk, but I chose to copy the instance of it located in the "C:\WINDOWS\ServicePackFiles\i386\" directory over to the "C:\WINDOWS\AppPatch" directory since that instance of the file had the exact same size and "date modified" properties as the original file. However, when I rebooted the laptop nothing had changed-- it still froze during the boot process throwing up the exact same error message that "Windows could not start because the following file is missing or corrupt: \WINDOWS\AppPatch\drvmain.sdb". Then, to be thorough, I also tried replacing the drvmain.sdb file on the laptop with a copy of it from another known working Windows XP Professional SP3 32-bit machine, but that also had no effect-- when the laptop booted it still froze in the same place throwing up the exact same error message. Lastly, I tried replacing the drvmain.sdb file with the copy of it that was on my Windows XP Professional installation CD-ROM. The copy of the file on the CD-ROM was older than the one on my machine and had a different file-size, but for the sake of trying all of the options I copied it over anyway, and as you might expect, the laptop *still* froze during boot at the very same spot and threw up the same error message. Defeated, I once again replaced the drvmain.sdb file with the one from the "C:\WINDOWS\ServicePackFiles\i386\" directory, because as I stated above, that copy of the file had the same file-size and file-date of the original.
I am now thinking that the problem with my Windows XP SP3 laptop not booting has nothing directly to do with the drvmain.sdb file being corrupted at all, and that the problem actually lies somewhere else with the above-mentioned error message being just a symptom of what is really going awry. Going on that hunch, I tried to research what the drvmain.sdb file actually does and what role that it plays in the operating system. I did this to try to get a better understanding of what was going on during that part of the Windows XP boot process and determine what could possibly cause the boot process to halt at that point. The best info that I could come across was this: A ".sdb" file is what is known as a "Shim Database File." These files are part of the Windows XP "Application Compatibility Core" feature. The drvmain.sdb file in particular is the shim database for Windows XP's "Driver Protection" feature. It stores a list of device drivers that are incompatible with Windows XP and prevents those device drivers from loading so that those drivers don't halt the Windows XP boot process or cause system instability. As a result, the drvmain.sdb file gets loaded before the rest of the system's device drivers in the Windows XP boot process so that the device drivers that get loaded after it can all be checked against the database for compatibility.
The only truly insightful information that I gained from my research is that you don't have to use a current version of the drvmain.sdb file if you don't want to. According to the Microsoft TechNet article "Driver Protection," you can use an older less-up-to-date version of the drvmain.sdb file if you wish to. This was enlightening to me because it meant that I wasn't getting the "Windows could not start because the following file is missing or corrupt: \WINDOWS\AppPatch\drvmain.sdb" error message due to using some not quite up-to-date version of the file-- according to the TechNet article any Windows XP-appropriate version of the database file should still work. Unfortunately, I did not gain any additional insight as to what else could cause the error message to appear. However, as I mentioned, I have tried several different copies of the drvmain.sdb file on my system now, so I really don't think that it is the drvmain.sdb file that is actually causing the problem.
Has anyone here encountered this problem before and successfully resolved it without resorting to something drastic such as performing a full-blown repair installation of Windows XP? If you have, please explain what you discovered was causing the error message and what you had to do to resolve it. I am extremely hesitant to the idea of using a Windows XP setup CD to try to install Windows XP over itself with a repair installation, as I am afraid that performing such a drastic and heavy-handed measure could end up causing me more problems than it solves. I would much rather get my laptop back up and running by identifying and fixing the actual problem that is preventing it from booting itself, which would both get my laptop back onto its feet with the least amount of "collateral damage," and provide me with the knowledge of how to fix this problem if it ever shows up again in the future.
Thank you in advance for your help, and hopefully someone here can shed some light on this!