1

I'd like to upgrade my application to use the newer Access 2007/2010 database engine. It currently stores its data in a Jet 4.0 (MDB) database. My application is written in Delphi, and it uses ADODB (ADO classic) to interact with the database. I'd like to upgrade the database engine from Jet 4.0 so that I can offer better encryption options.

I changed the connection string in my application to use Microsoft.ACE.OLEDB.12.0 and despite a few hiccups, the conversion went amazingly well! Impressive backward compatibility.

I also distribute my application in a Wine bundle for Mac users. I'm running into a few problems with running my application under the Access 2010 Database Engine on Wine (1.4-rc1). Strange access violations appear. When I install the Access 2007 Database Engine on Wine instead, my application works great. Just as good as with Jet 4.0. So it appears that the Access 2010 Database Engine isn't quite ready for Wine. Bummer!

The problem I'm running into is that if you have the Access 2010 Database Engine on your Windows machine (such as when you install Access 2010), when it creates a new database it encrypts it using a higher form of security that is incompatible with Access 2007. Users of my application couldn't share their database between their PC and Mac (i.e. via Dropbox) since they would no longer be compatible.

In Access 2010, you can set an option for it to "Use legacy encryption". This option causes Access 2010 to create new databases using an encryption that is compatible with Access 2007. This option sets a registry key "CompatMode", and the Access 2010 application must take a different approach to creating new databases in this case.

My question is: How can I programmatically create an encrypted database that is Access 2007 compatible from the Access 2010 database engine? If the Access 2010 application can do it, how can I? I'm aware of two techniques for creating an Access database: 1. via DAO (DBEngine.CreateDatabase), 2. via ADOX (Catalog.Create). I've been trying various approaches to these two techniques, and can't come up with anything that creates an encrypted database that is Access 2007 compatible.

Fionnuala
  • 90,370
  • 7
  • 114
  • 152
Troy
  • 1,237
  • 2
  • 13
  • 27
  • It's something to consider as a last resort. I'd still like to know how Access 2010 is doing it. ;) – Troy Feb 03 '12 at 17:52
  • I did more testing and found out that I had the same access violations when testing ACE 2010 on Windows XP SP3. So the bugs were not specific to Wine. I fixed the bugs I had so that ACE 2010 runs well on XP, and now it works fine on Wine as well. What a good day! I even found out I can install the ACE 2010 Engine on a machine w/ Office 2010 64-bit. I was expecting that to fail, but it didn't. – Troy Feb 03 '12 at 23:48

0 Answers0