Forum Discussion
Connecting to an encrypted .accdb file
- Aug 30, 2021
I seem to have stumbled on a solution! Building the connection string to my legacy-encrypted DB in Delphi gives me the following, some of which is probably redundant (placeholders for other users to populate denoted by <text>):
Provider=Microsoft.ACE.OLEDB.16.0;User ID=Admin;Data Source=<full path to DB file>;Mode=Share Deny None;Jet OLEDB:System database=<full path to System.mdw file>;Jet OLEDB:Registry Path="";Jet OLEDB:Database Password=<password - no quote marks>;Jet OLEDB:Engine Type=6;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=<as before>;Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=True;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False;Jet OLEDB:Support Complex Data=False;Jet OLEDB:Bypass UserInfo Validation=False;Jet OLEDB:Limited DB Caching=False;Jet OLEDB:Bypass ChoiceField Validation=False;
The secret seems to be that you must either have the login prompt facility turned off and connect automatically or, if it is on, leave both username and password blank when connecting.
I hope this helps someone. It's been haunting me for weeks!
"Cannot start your application. The workgroup information file is missing or opened exclusively by another user.".
Workgroup information files (MDW) were part of user level security (ULS) which was a feature deprecated with the advent of the .ACCDB file format in A2007.
Is this an old .MDB file with ULS that you converted to .ACCDB? If so, perhaps it still contains references to the MDW file even though it no longer works. Have you tried importing all objects into a new blank database or decompiling to remove all existing compilation code?
- Dicky_g141Aug 25, 2021Brass ContributorAs I mentioned in my original post, there is lots of evidence on the internet that it is not possible to connect to a .accdb database with default encryption so I had to set up my brand-new test dB with legacy encryption. This may be what causes the reference to the .mdw file which does exist on my machine in c:\users\myname\AppData\roaming\Microsoft\Access. I have tried referencing this in the connection string and also adding user=Admin (which appears in the .mdw) but none of my efforts have been successful.