Windows XP boot process halting at a black screen with the error, "Windows could not start because the following file is missing or corrupt: \WINDOWS\AppPatch\drvmain.sdb"

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!

 

Question Info


Last updated April 10, 2019 Views 1,940 Applies to:

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Hi,

I would suggest you to refer to these links and check.

 

Problems with \WINDOWS\AppPatch\drvmain.sdb at start up: http://answers.microsoft.com/en-us/windows/forum/windows_xp-system/problems-with-windowsapppatchdrvmainsdb-at-start/fdc03cef-f5cc-44c5-be62-a58d2b152555

 

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/bootcons_fixmbr.mspx?mfr=true

Hope this helps.


Srimadhwa B,

 

Thank you very much for your reply-- I greatly appreciate your taking some of your time to attempt to try and assist me.  I read through both of the pages that you linked to very thoroughly, and unfortunately I don't think that either of them can help me with my particular problem.  The first hyperlink, which linked to a Microsoft Answers forum thread entitled, "Problems with \WINDOWS\AppPatch\drvmain.sdb at start up," seemed very promising at first, but it turns out that in that person's case the reason why his Windows XP machine was throwing up the error message "Windows could not start because the following file is missing or corrupt: \WINDOWS\AppPatch\drvmain.sdb" was because his Windows XP machine actually was missing the drvmain.sdb file.  Once that person copied that file over to the appropriate directory on their machine, it quit giving that particular error message when it was being boot up.  In my case, I always had the drvmain.sdb file on my machine to begin with, and just in case my copy of the file was actually corrupt I replaced it with other copies of the drvmain.sdb file taken from several other sources.  Despite this, my Windows XP laptop still halted its boot with the "missing or corrupt drvmain.sdb" file every time, no matter which drvmain.sdb file that I am using.  Some of the other suggestions made in that Microsoft Answers thread, such as running chkdsk /r from the Windows XP Recovery Console until it reports no errors, is something that I have already tried as well.

 

The second resource that you linked to was an article from the Microsoft Windows XP Professional documentation on how to use the "fixmbr" command in the Windows XP Recovery Console to repair my computer's Master Boot Record (MBR).  Based on everything that I have observed thus far, my Master Boot Record shouldn't be the problem.  I arrived at this conclusion because my computer is failing too far along in the boot process for me to have a bad MBR.  To explain, the Master Boot Record essentially holds two pieces of information: the hard disk's partition table, and the first stage of the bootstrap loader for the operating system.  If my partition table was bad the computer wouldn't be able to detect the file system on my hard disk at all, however that is not the case.  I am able to see my files and directories just fine from both the Windows XP Recovery Console and the Linux PartedMagic Live CD, and if my MBR was bad that probably wouldn't be possible.  In addition, I know that the first stage of the boot loader is working fine, as my laptop is successfully loading the "ntldr" file, which is the second stage of the Windows XP boot process.  If my MBR was bad, the ntldr file most likely wouldn't be able to be loaded.

 

Based on the very good Microsoft TechNet article, "Troubleshooting the Startup Process," the Windows XP boot process is as follows:

  1. Power-on self test (POST) phase
  2. Initial startup phase
  3. Boot loader phase
  4. Detect and configure hardware phase
  5. Kernel loading phase
  6. Logon phase

The MBR comes into play during phase 2 of the boot process, the "Initial Startup Phase."  My Windows XP machine is halting during phase 5, the "Kernel Loading Phase," when Ntldr and Ntoskrnl.exe are trying to load the device driver shim database before it loads the device drivers for my system.  If a bad MBR was to blame I really shouldn't be able to get to phase 5 in the boot process-- I would instead probably be halting at phase 2 or 3.

 

Instead, I am starting to suspect that one of three things might be causing my problem here:

  1. A damaged NTFS file system, which would prevent Ntldr and Ntoskrnl.exe from "seeing" my "C:\WINDOWS\AppPatch\drvmain.sdb" file.  With that said, I don't think that this is the case, since chkdsk /r runs without detecting any errors every time, and I am able to access the directory and file in question just fine from both the Windows XP Recovery Console and a Linux Live CD.
  2. The system files Ntldr or Ntoskrnl.exe may be corrupted, however I don't think that this is very likely either.  This is because the boot process would most likely fail long before the kernel started loading the device drivers if these two crucial system files were borked in any way.
  3. I may have a seriously messed up Windows registry.  The device drivers that get loaded during startup are determined by a Windows registry key, "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\servicename".  Maybe the entry in the registry for the drvmain.sdb file is corrupted.  Unfortunately, I have not been able to look into this possibility yet since I have yet to figure out how to view and edit my laptop's Windows registry from the Windows XP Recovery Console.  If anyone out there knows a good way to do this, I would definitely be interested in learning how.

I don't really know if any of the three suspects that I mentioned above are to blame for my booting problem, but that is the direction that I am currently going to investigate in right now.  In any case, thanks for your suggestions thus far-- they may have not solved my problem, but I don't mind having ideas bounced off of me.  In the mean time I am going to continue to keep on trying to troubleshoot this problem.  Everyone please feel free to keep posting their troubleshooting solutions or suggestions, and if I somehow manage to solve this problem on my own I will definitely post the solution here so that others with the same problem can benefit from it.  Thanks!

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

This is a peculiar problem...

You can't look at the Registry from the XP Recovery Console, but you can from a Hiren's boot CD that you can download from here (a sizable download but worth it):

http://www.hirensbootcd.org/download/

Burn the ISO to create a bootable Hiren's CD, boot on it and choose the Mini XP mode and there are lots of tools on there.

If you have never burned an ISO to make a bootable CD, I like to use ImgBurn:

Use a new CD and this free and easy program to burn your ISO file and create your bootable CD (do not install UniBlue or the Ask Toolbar - ever!):

http://www.imgburn.com/

Here are some instructions for ImgBurn:

http://forum.imgburn.com/index.php?showtopic=61


Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Hello Hoagiebot,

I have just encountered the problem of my Win XP not booting up due to the same reason you explained in your 8/24/12 post.  Windows XP boot process halting at a black screen with the error, "Windows could not start because the following file is missing or corrupt: \WINDOWS\AppPatch\drvmain.sdb"

Did you find a solution to fix the non-boot problem w/o having to reinstall Win XP?  I will do this if it is what is necessary but since it is after the 4/8/14 support date I do not know where I will be able to download all the updates and patches for Win XP. Also, I have never backed up Win XP Pro. 

My main difference in OS install is that I have 2 Seagate 320GB drives set in a RAID 0 array with 2 partitions.  The 1st was made for Win XP.  XP Pro was installed 1st.  The 2nd partition was for Win 7 and was installed after Win XP was setup.  I can still get into Win 7 just fine and have replaced my drvmain file with one from my laptop that also uses Win XP Professional w/ SP3. Exact same file size and date. No help.  I have not run chkdsk /r yet but will do so to verify hard drive health is OK.  Thank you for your time.

Sincerely,

John

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

XP will boot just fine if the drvmain.sbd file is missing or if the file is corrupt.

To verify this boot into the XP Recovery Console so Windows File Protection is not running, navigate to the c:\windows\apppatch folder (assuming XP is installed on the C drive in the Windows folder) and rename the drvmain.sdb file to something you can remember:

rename drvmain.sdb   drvmain.xxx

Now the file is "missing".

Restart your system and it will boot just fine, but you will have two events in the Event Viewer System log:

Event Type:    Error
Event Source:    Application Popup
Event Category:    None
Event ID:    877
Date:        4/21/2015
Time:        1:56:36 AM
Description:
There was error [DATABASE OPEN FAILED] processing the driver database.


Event Type:    Error
Event Source:    Application Popup
Event Category:    None
Event ID:    877
Date:        4/21/2015
Time:        1:56:36 AM
Description:
There was error [DATABASE NOT LOADED] processing the driver database.

Then reboot into the Recovery Console and put in a "corrupt" drvmain.sdb file and I like to "corrupt" XP system files by copying something over the top of them like this:

copy  c:\boot.ini   c:\windows\apppatch\drvmain.sdb

Now the drvmain.sdb file is present, but it is "corrupt".

Reboot normally and XP will boot just fine with the same two messages in the Event Viewer System log and a third message:

Event Type:    Error
Event Source:    Application Popup
Event Category:    None
Event ID:    877
Date:        4/21/2015
Time:        2:01:31 AM
Description:
There was error [INIT DATABASE FAILED] processing the driver database.

So you have verified that XP will boot just fine if the drvmain.sdb file is missing or corrupt.

Since we know XP keeps copies of important files in the dllcache folder, be sure to replace the missing/corrupt file either by renaming the copy made earlier or entering:

copy c:\windows\system32\dllcache\drvmain.sdb   c:\windows\apppatch

Respond in the affirmative if asked to overwrite an existing file.

The problem with troubleshooting the message is nobody tells any details about how the system got into this condition in the first place - what happened prior to the incident of not booting?

Editing the registry will not help - unless you edited the registry beforehand and messed it up somehow.

Running fixmbr will not help since there are no symptoms indicating a missing or corrupt MBR and the Microsoft engaged Support Engineer "expert" fails to warn that if your system has a built in Recovery Partition from the factory, you will not be able to use it after running fixmbr.  These are just more of their wild goose chases when they have no idea what the problem is or how to fix it.


There is something else wrong and without knowing what happened prior (or any other system details) all you can do is start guessing and trying things, or pursuing wild goose chases and I tend not to waste time on such things.

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.