QuickBooks Error C=22: Rebuild Fails on a Damaged Record
Error C=22 means QuickBooks found a record that fails its integrity check. Our engineers explain the triggers and walk through the repair.
A C=22 result is one of the clearer signals QuickBooks Desktop gives you. The company file opens, most of it reads normally, but at least one stored record no longer matches the structure around it. The software cannot reconcile that difference by itself, so it stops and reports the code. Our engineers meet this error often, and the order of the steps below reflects the order we work in.
The message on screen
The code seldom appears on its own. It shows up at the end of a Verify Data run, or in the dialog that interrupts the file open, and the text around it names the record involved.
QuickBooks has detected a problem with your company file. Use Rebuild Data to correct it. Error: C=22
Exact wording shifts between QuickBooks years and editions. The constants are the code and the record line beneath it, which usually names a list or a transaction type. Write that record down before you close the window. It is what makes the later steps quicker, and it tells you whether the same record fails every time.
C=22 in plain terms
QuickBooks groups company file problems under the letter C, and 22 is the specific failure the integrity check raised. A transaction is stored as linked parts: a header, one or more lines, and index entries that point at both. When one part is written incompletely, or a pointer lands somewhere it should not, Verify Data sees the mismatch and reports the code.
Nothing has been lost at this stage. The record is still in the file, but its internal consistency is broken. That distinction matters, because it means the first attempts at repair should preserve the record rather than remove it.
Triggers that get a file to this state
The causes we see repeatedly:
- A write interrupted midway. Power loss, a forced shutdown, or a laptop sleeping while a transaction posts.
- Multi-user work over a weak link. A dropped connection during posting leaves a partially written record behind.
- A company file held in a synced folder. Cloud sync clients and cached network shares can copy the file while it is being written.
- A restore or migration that pulled data from two sources into one file.
- Third-party add-ons writing into the file directly rather than through the normal interface.
- Failing storage. If C=22 names a different record on each run, suspect the drive or the path before the data.
Fixing C=22, one scenario at a time
A rebuild clears it
This is the common outcome, and it is where we start.
- Have every user sign out of the company file. The rebuild will not run while the file is in multi-user mode.
- Back up first: File > Back Up Company > Create Local Backup. Keep the backup somewhere other than the working folder.
- On the machine hosting the file, choose File > Utilities > Rebuild Data, then let it finish without interruption.
- Run Verify Data afterwards. A clean result means the file is consistent again.
- Open the company file and inspect the record the original message named, checking totals, dates and the linked accounts.
The rebuild completes but the same record returns
When the code keeps attaching to one record, that record needs to be rewritten rather than repaired in place.
- Note the type, date and number or name of the record.
- For a list entry, export the list to a spreadsheet, remove the entry, then re-import it cleanly from the export.
- For a transaction, open it and make a minor edit, such as re-selecting the same account, then save. Saving rewrites the record. If it will not open at all, re-enter it from the original paperwork and keep the broken copy until the new one is verified.
- Rebuild and verify again before entering live work.
The rebuild will not finish or the file will not open
- Copy the company file to the local drive of the machine doing the rebuild and test there. If the copy behaves, the network path was the problem, not the data.
- Restore the most recent backup that verifies clean, then re-enter only the transactions that came after it.
- Turn off third-party integrated applications temporarily through Edit > Preferences > Integrated Applications, then retry the rebuild.
- If C=22 survives all of the above, the damage is past what the built-in utilities can address and the file needs attention at the data level. Our QuickBooks company file repair service works on the file directly and reports back what can be recovered before any work is charged.
Keeping C=22 from coming back
Most of the prevention sits outside QuickBooks. Keep the company file on a local drive on the machine that hosts it, with the database server running there, and give users a wired connection rather than a cached share. Never leave the file in a folder that a sync service watches.
Exit through File > Exit each time, so the file closes cleanly instead of being cut off. Run Verify Data on a copy once a month, so a small inconsistency surfaces before it becomes an open failure. Test a restore occasionally, since a backup nobody has restored is only a guess. Keep add-ons current, and remove the ones nobody uses. A file that is checked regularly and stored properly rarely reaches the point where C=22 stops work.