I receive an error message and I don't know what to do about it.
IO have a delphi app using a MS Access 2010 database. I connect to it through BDE. It worked perfectly until today when the users told me that they can't enter my application due an error message:
When I tried to open the database for repair in Access it didn't recognize my password. And The message was:
"You or another user may have unexpectedly quit MSACCESS while a MS Access database was open.
Do you want MS Access to attempt to repair the database?"
And then again" Not a valid password" and then "The database xxx.mdb' can't be repaired or isn't a MS Access database file"

Dani AI

Generated

Short diagnosis and what that sequence of messages usually means

The chain of dialogs — “Attempt to repair”, then “Not a valid password”, then “…can't be repaired or isn't a MS Access database file” — most often points to corruption of the database header or initial pages. When those first bytes are damaged Access can treat the file as password‑protected even when no password was set, and standard Compact/Repair may fail. Verifying that the file is actually a Jet/MDB file (its header normally contains the ASCII marker "Standard Jet DB") helps rule out a wrong file type or an accidental conversion. ()

Safe, ordered triage (operate on copies only)

  1. Immediately take the original .mdb offline and make a bit‑for‑bit copy (do not open the original with Access or any repair tool).
  2. Confirm the copy’s file size and timestamps; check for a same‑name .ldb/.laccdb and remove it only after confirming nobody has the DB open.
  3. On a machine with the same Access/Jet environment used by the app, attempt to open the copy exclusively and run Compact & Repair.
  4. If Access’s compact fails, try the Microsoft Jet Compact utility (jetcomp.exe) on the copy — it sometimes succeeds where Access cannot because it doesn’t try to open the DB first. ()

Password prompts, MDW vs database password, and recovery limits

Access has both a database password and (older) workgroup/MDW user‑level security; mixing these up or missing the workgroup file will block ODBC/BDE opens. However, if the header itself is scrambled (or the MDB was saved by a non‑Access program) the database will prompt for a password and is usually unrecoverable except from a backup or by specialist recovery services. Service‑pack/MDAC issues have also caused “Not a valid password” during compaction in the past — verify runtime/MDAC versions if the environment is old. (ftp.zx.net.nz)

Next steps and longer‑term fixes

Restore the last known good backup first (as and stressed). If no backup exists, consider a professional recovery vendor. If this is a production system using BDE, plan migration away from BDE (it’s deprecated) and add automatic, tested backups and file‑level checksums. Repeated corruption usually traces back to unreliable storage, network/NAS setups, or abrupt terminations — investigate hardware, SMB/antivirus interactions, and server event logs. (embarcadero.com)

Notes tied to earlier replies

  • JetComp and import‑into‑new‑MDB are valid next attempts (see and ), but always run them on copies.
  • Tools that attempt to crack or remove passwords (see ) should be used only on copies and from reputable vendors, and only when legal/authorized.
  • If corruption is rare and size is small, continued Access use is defensible (as notes) — but add automated backups and a migration plan to a server DB for production data.

Recommended Answers

All 7 Replies

It's a sadly common problem. Remember I take this post as sincere and not a shill posting about Access repair tools which anyone can google about.

-> As an author not only would you write the app but educate the users about backups and more. On your part you can consider buidling backup into your app. For example you might design this to copy the database at start if it opens successfully or on exit. We all know Access databases creates business for recovery companies and sadly those repair.com sites.

In short, they need to pull their last good backup copy and move forward.

Look for TriSun Software, they have a MS Access Password Cracker application, does a fair job at displaying MS Access Passwords. Sells for 19.99

NEVER use MS Access for a production database. SQL Server is good, as are most other high-end DBMS servers such as Oracle, Informix, Postgres, MySQL, etc. Access databases are good for pre-production testing of your other code, but when you are ready, use a real database.

commented: Words for the wise. Tears for the foolish. +12

I'm hoping you are keeping good and timely backups. You can try the Microsoft JetComp tool.
If this doesn't get it done,...
Try importing all the objects from your MDB into a NEW MDB,... if not...
I would do some investigation of the BDE to see if it is leaving suspect logons in place after its use of the mdb is concluded.

Thank you guys for your feedback and help. Thank you!

check to make sure proper versions of the access db and the programs that talk to it are being used, and check for security leaks where someone might be trying to open the DB. I've seen plenty of times where an older DB get's converted to newer versions rewriting the db, or by a 'curious' user trying to see the data within. Other than that..... backup backup backup.... good luck!

Re. Rubberman's comment. I have been using an Access 2010 database for a little over 4 years, and have never had a data corruption problem. I did have corruption problems with prior versions of Access. My database is not huge, the largest table containts about 10,000 rows/records with 18 columns and additional rows added frequesntly, and it is for my personal use only. Maybe I've just been lucky, so I do keep frequent and regular backups in case. Just FWIW.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.