Menu

What does this error mean, and how can I fix it?

Help
amwfc
2022-09-16
2022-12-16
  • amwfc

    amwfc - 2022-09-16

    Unexpected Error occurred attempting to open an SQL connection.
    class com.healthmarketscience.jackcess.impl.UnsupportedCodecException: Decoding not supported. Please choose a CodecProvider which supports reading the current database encoding.

     
  • amwfc

    amwfc - 2022-09-21

    We are kind of dead in the water, due to the above error. Any tips on resolving it?

     
  • amwfc

    amwfc - 2022-09-22

    It is a password-protected DB. We connect through UcanAccess from Squirrel SQL. It is not clear how to connect. Are you able to point us in the right direction, i.e. a link to documentation that shows how to write a connection string?
    Or is it something that Squirrel SQL developer has to implement?

     
    • Alexander Maas

      Alexander Maas - 2022-09-23

      When using SQuirrel to connect to an encrypted access database, you have to follow the following steps:

      1) Neccessary Libraries:

      Download the following Libraries:

      • ucanaccess-5.0.1.jar
      • jackcess-4.0.2.jar
      • hsqldb-2.7.0.jar
      • commons-lang3-3.12.0.jar

      ... and to use the encryption feature also these libs:

      • bcprov-jdk15on-1.70.jar
      • jackcess-encrypt-4.0.1.jar

      Place them in your drivers folder, e.g. C:\Program Files\Squirrel\drivers

      2) Compile your Crypt Codec Opener:

      Create a file CryptCodecOpener.java (e.g. in "C:\Program Files\Squirrel\drivers")

      import java.io.File;
      import java.io.IOException;
      import net.ucanaccess.jdbc.JackcessOpenerInterface;
      import com.healthmarketscience.jackcess.crypt.CryptCodecProvider;
      import com.healthmarketscience.jackcess.Database;
      import com.healthmarketscience.jackcess.DatabaseBuilder;
      
      public class CryptCodecOpener implements JackcessOpenerInterface {
          @Override
          public Database open(File fl,String pwd) throws IOException {
             DatabaseBuilder dbd =new DatabaseBuilder(fl);
             dbd.setCodecProvider(new CryptCodecProvider(pwd));
             dbd.setAutoSync(true);   // Notice that the parameter setting autosync=true is recommended with UCanAccess for performance reasons
             dbd.setReadOnly(false);
             return dbd.open();
          }
      }
      

      ... and compile it using: javac -cp "%CLASSPATH%;*" CryptCodecOpener.java

      3) Configure Driver in SQuirrel
      - Change Driver, Extra Class Path, Add the folder where your 'CryptCodecOpener.class' is located
      - Modify your connection string: e.g. "jdbc:ucanaccess://C:\Somewhere\MyDatabase.accdb;showschema=true;jackcessOpener=CryptCodecOpener"

      Now you'll be able to connect to your encrypted access database.

      Good luck :-)

       
  • amwfc

    amwfc - 2022-09-24

    Too bad :( We do not have software developers for the coding of that.

     
    • Adam Csaba Szell

      Too bad :( We do not have software developers for the coding of that

      Uhm, excuse me if I'm being rude, but you don't need a dev to do this.

      LoL

       

Log in to post a comment.