Quick answer
QuickBooks error 6140 is a company file access error: QuickBooks cannot find or open the .QBW file you selected. It usually follows a moved, renamed, or restored file, a changed mapped drive, or a broken multi-user path. Confirm the current file location, open it from a local copy, fix permissions and hosting, and only then repair the data.
What error 6140 means
Error 6140 belongs to the 6000-series of company-file access failures in QuickBooks Desktop Pro, Premier, Enterprise, and QuickBooks Accountant. The dialog tells you that an error occurred when QuickBooks tried to access the company file, then prints a code that starts with -6140, sometimes followed by a second number.
In practice, QuickBooks knows which file it wants, but the path, the Windows account, or the network will not let it through. The file itself is often healthy, so the fastest fixes are reversible: locate the file, open it from a clean location, and repair the path. Rebuilding data and restoring backups come later, if at all.
Desktop only. If you see 6140 inside QuickBooks Online or in a third-party app that syncs with it, you have a different problem: QuickBooks Online error 6140 is a duplicate document number on an invoice, bill, or check. Renumber the transaction and resync. The steps below apply to QuickBooks Desktop company files.
Symptoms that come with error 6140
- It appears the moment you select the file, often from a shortcut or recent-file entry that worked yesterday.
- The path printed in the message no longer exists, or it names a drive letter such as
Z:that is no longer assigned. - File → Open or Restore Company opens the same file even though the old shortcut cannot.
- One workstation fails while the server opens the same company file without a problem.
Common causes, ranked by how often they occur
- The company file moved or was renamed. Windows shortcuts and QuickBooks remember the old path, so the outdated entry fails even though the
.QBWis safe in a new folder. - A mapped drive letter changed. Windows reassigns letters after reboots, VPN sessions, and Remote Desktop logins, so QuickBooks reaches for a path that no longer resolves.
- Folder permissions changed. A new Windows profile, a domain change, or a Windows update can strip Modify rights or leave the
QBDataServiceUserXXaccount out of the share. - Hosting is enabled on more than one computer. Conflicting hosts create competing paths, and access fails on whichever machine loses the race.
- Stale support files. An
.ND,.TLG, or.DSNfile created for the old location can block access after a move, copy, or restore. - The file is compressed, encrypted, or marked Read Only. QuickBooks cannot open a
.QBWthat Windows or a third-party tool has locked down.
Before you begin
- Back up the entire company-file folder. Copy the
.QBWand its.ND,.TLG, and.DSNcompanions to an external drive or a second computer. - Have Windows administrator credentials ready. Share and permission changes require an admin account.
- Know your version. Press F2 in QuickBooks to see the exact release and the hosting status.
- Allow 20–40 minutes. Finding the file and testing a copy takes under 15; a large-file Verify or Rebuild adds more.
How to fix QuickBooks error 6140
Work in this order. The first six steps are reversible. The data repairs come last, after your backup exists.
Find the company file with a wildcard search
Open File Explorer on the computer that should hold the file, type *.qbw in the search box, and press Enter. The default location is C:\Users\Public\Public Documents\Intuit\QuickBooks\Company Files, but a move or restore may have sent yours elsewhere.
Repeat the search for *.qbb and *.qba; a backup or accountant's copy tells you the working file was replaced, not lost. Write down the full folder path. If the search returns nothing, follow the company file not found recovery steps.
Open the file through QuickBooks, not a shortcut
Start QuickBooks, then choose File → Open or Restore Company → Open a Company File → Next and browse to the .QBW you found. This updates the path QuickBooks stores internally and clears the stale entry that caused the error.
If the file lives on a server, open it with the UNC path (\\Server\Share\CompanyFile.qbw) rather than a drive letter. UNC paths survive mapped-drive changes and prevent most repeat 6140 errors.
Test a local copy to separate data from location
Close QuickBooks. Copy only the .QBW file to a new folder on your local C: drive, for example C:\QBTest, and open that copy through File → Open or Restore Company. Do not copy the old .ND with it; QuickBooks creates a fresh one.
If the copy opens, the data is fine and the original path, share, or permissions are the problem. Fix the location, then delete the test copy. If the local copy also fails, continue below.
Repair the path on shortcuts, scans, and mapped drives
Delete old desktop shortcuts and pinned items that point at the previous location, then rebuild them from the current folder. If QuickBooks uses a mapped drive, reconnect it or switch the company-file path to the UNC form.
On the server, open QuickBooks Database Server Manager, go to the Scan Folders tab, select Browse, point it at the company-file folder, and select Start Scan. The scan rebuilds the network descriptor and firewall permissions for the new path. For the full setup, see QuickBooks multi-user setup.
Restore folder permissions and clear Read Only
Right-click the folder that contains the company file, choose Properties → Security, and confirm your Windows account and QBDataServiceUserXX (the XX matches your version) have Full Control or Modify. If the folder is shared, repeat on the Sharing tab. Intuit documents the exact rights, including Read Attributes and Create Files/Write Data.
Then right-click the .QBW file, choose Properties, and confirm Read-only is cleared. On the same dialog, select Advanced and clear Compress and Encrypt if either is checked.
Leave hosting enabled on the server only
On every workstation, open QuickBooks without opening the company file and go to File → Utilities. If Stop Hosting Multi-User Access appears, select it; if you see Host Multi-User Access, leave it alone. The workstation is not hosting, so nothing needs to change.
On the server, use File → Utilities to stop and restart hosting once, then leave hosting on. Press F2 to confirm the Local Server Information section shows hosting active. A second active host is a common reason one machine gets 6140 while the rest work.
Rename the .ND, .TLG, and .DSN support files
Close QuickBooks on every computer. In the company-file folder, find the files that share the company file's base name with the extensions .ND, .TLG, and .DSN. Rename each by adding .old to the end, so company.qbw.nd becomes company.qbw.nd.old.
These are connection and log files, not accounting data; QuickBooks recreates them when you open the file or scan the folder. Keep the renamed copies until the file opens twice.
Back up before rebuilding or restoring. Verify is read-only, but Rebuild, File Doctor repair, and restore can change or replace the file. Confirm your folder copy and a fresh File → Back Up Company backup exist before step 8.
Run Verify Data, then Rebuild Data
Open the company file and go to Window → Close All, then File → Utilities → Verify Data. If the result says QuickBooks detected no problems with your data, the file is healthy and 6140 was purely a path or permission problem. If it says your data has lost integrity, continue.
Run File → Utilities → Rebuild Data and save the required backup under a new file name. QuickBooks can look frozen while rebuilding; if the mouse pointer moves, it is working. Verify again when it finishes — two or three rebuild passes are normal. If rebuild cannot repair the file, restore the newest clean backup as a separate workflow and keep the original untouched for a data-recovery specialist.
Verify the fix
- Close QuickBooks, reopen it as a standard user, and open the company file from its normal location — not from the test copy.
- Press F2 and confirm the file path, version, and hosting status are correct.
- Run File → Utilities → Verify Data once more and confirm it reports no problems.
- If you use multi-user mode, open the file from a second computer, post a test transaction, and delete it.
- Back up the file with File → Back Up Company and store the backup off the machine.
If error 6140 keeps coming back
Repeat failures usually mean the file still sits in a location that changes underneath it. Move company files off OneDrive, Dropbox, and similar sync folders — those tools lock the .QBW intermittently. On a network, give the server a static IP address and turn off sleep on the host so the path never disappears.
If the file still refuses to open from a local copy after Verify and Rebuild, treat it as data damage. Work through company file repair, then contact Intuit support or a data-recovery service if rebuild cannot fix it. Keep the damaged original untouched; repeated rebuild attempts reduce what a recovery service can salvage. Testing whether a sample company file opens tells you whether the file or the installation is at fault. Errors in the same family, such as error 6000, follow the same diagnostic order.
Prevention
- Store company files in a local folder or a properly shared server folder, never in a consumer sync folder.
- Use UNC paths for network files so a drive-letter change never breaks the link again.
- Keep hosting on the server only, and let Database Server Manager monitor the drives that hold your files.
- Back up on a schedule and test a restore each quarter; see QuickBooks backup and restore.
- Run Verify Data twice a year and before every version upgrade.
Frequently asked questions
Does error 6140 mean my company file is corrupted?
Usually not. Corruption is the least common cause. If the same file opens from a local copy or from the server, the data is fine and the problem is the path, the share, or hosting. Verify Data confirms which situation you have.
Can I delete the .ND file to fix error 6140?
Rename it instead of deleting it. The .ND file holds the host name, IP address, and port QuickBooks uses to reach the file over a network, so a stale copy points workstations at the old location. QuickBooks rebuilds it when you open the file or scan the folder.
Can I fix error 6140 without a backup?
You can safely try steps 1 through 7 — finding the file, opening it correctly, testing a copy, fixing permissions and hosting, and renaming support files. Do not run Rebuild, File Doctor repair, or a restore until you have a copy of the company-file folder.
What if the file opens locally but not over the network?
The file is healthy and the network path is the issue. Confirm the server folder is shared with QBDataServiceUserXX at Full Control, check that the firewall allows the QuickBooks database service, and scan the folder with Database Server Manager. A host that sleeps or loses its IP address produces the same symptom.
Sources & further reading
- Company file is missing or cannot be found — Intuit QuickBooks Help
- Can't open your company file in QuickBooks Desktop — Intuit QuickBooks Help
- Set up folder and Windows access permissions to share company files — Intuit
- Use QuickBooks Database Server Manager — Intuit QuickBooks Help
- Verify and rebuild data in QuickBooks Desktop — Intuit QuickBooks Help