Leo Ribeiro
Leo Ribeiro

Reputation: 1255

Why UCanAccess needs password and Jackcess doesn't?

Recently I've had been using (testing) both solutions to get some data from Access (MDB file). And I perceived that Jackcess doesn't need password to access the database's data, while UCanAccess only works if I insert the password (if the database has).

So, wtf really happens? If Jackcess is a dependency of UCanAccess, why does it needs password? Or why does Jackcess doesn't require password too?

Thanks!

Upvotes: 1

Views: 909

Answers (1)

Gord Thompson
Gord Thompson

Reputation: 123549

When a database password is assigned to an older-format .mdb database the file is not actually encrypted. (Older versions of the MS Access application had a separate option to encrypt the file, but even that protection was pretty weak.)

If the file is not encrypted then Jackcess does not require a password to open it. In fact, Jackcess provides a way to retrieve the database password from an unencrypted (but "password protected") .mdb file.

As suggested in the comment to your question, the UCanAccess development team decided to remain consistent with the other higher-level data access methods and require that the user supply the correct password while opening the database. If you really wanted to avoid coding the database password into a UCanAccess application then you could always

  • open the database file with Jackcess first,
  • use Jackcess calls to retrieve the database password,
  • close the Jackcess connection to the database, and then
  • supply the database password when opening the UCanAccess connection to the database.

Note that when applying a database password to a newer-format .accdb database the file really is encrypted, so both Jackcess and UCanAccess require the correct password (along with the additional component "Jackcess Encrypt", plus dependencies) to open it.

Upvotes: 3

Related Questions