Hi,
I tried to open a password protected Access 2007 database with jackcess-encrypt-2.1.1.jar but I get the following exception. com.healthmarketscience.jackcess.impl.UnsupportedCodecException: Decoding not supported. Please choose a CodecProvider which supports reading the current database encoding.
Please provide the details to open a password protected db.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Database db = new DatabaseBuilder().setReadOnly(true).setCodecProvider(new CryptCodecProvider("test")).open(file);
com.healthmarketscience.jackcess.impl.UnsupportedCodecException: Decoding not supported. Please choose a CodecProvider which supports reading the current database encoding.
at com.healthmarketscience.jackcess.impl.DefaultCodecProvider$UnsupportedHandler.decodePage(DefaultCodecProvider.java:126)
at com.healthmarketscience.jackcess.impl.PageChannel.readPage(PageChannel.java:224)
at com.healthmarketscience.jackcess.impl.UsageMap.read(UsageMap.java:130)
at com.healthmarketscience.jackcess.impl.PageChannel.initialize(PageChannel.java:117)
at com.healthmarketscience.jackcess.impl.DatabaseImpl.<init>(DatabaseImpl.java:524)
at com.healthmarketscience.jackcess.impl.DatabaseImpl.open(DatabaseImpl.java:393)
at com.healthmarketscience.jackcess.DatabaseBuilder.open(DatabaseBuilder.java:252)
at com.healthmarketscience.jackcess.DatabaseBuilder.open(DatabaseBuilder.java:291)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are trying to use the static .open(file) method on a new instance of DatabaseBuilder, and that does not seem to work with .setCodecProvider. Try using .setFile(file) and .open() instead:
Database db = new DatabaseBuilder()
.setFile(file)
.setReadOnly(true)
.setCodecProvider(new CryptCodecProvider("test"))
.open();
Last edit: Gord Thompson 2016-12-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I tried to open a password protected Access 2007 database with jackcess-encrypt-2.1.1.jar but I get the following exception.
com.healthmarketscience.jackcess.impl.UnsupportedCodecException: Decoding not supported. Please choose a CodecProvider which supports reading the current database encoding.
Please provide the details to open a password protected db.
any details you can provide regarding the test code you are using and the exact error you are encountering (full stack trace) would be great.
Database db = new DatabaseBuilder().setReadOnly(true).setCodecProvider(new CryptCodecProvider("test")).open(file);
com.healthmarketscience.jackcess.impl.UnsupportedCodecException: Decoding not supported. Please choose a CodecProvider which supports reading the current database encoding.
at com.healthmarketscience.jackcess.impl.DefaultCodecProvider$UnsupportedHandler.decodePage(DefaultCodecProvider.java:126)
at com.healthmarketscience.jackcess.impl.PageChannel.readPage(PageChannel.java:224)
at com.healthmarketscience.jackcess.impl.UsageMap.read(UsageMap.java:130)
at com.healthmarketscience.jackcess.impl.PageChannel.initialize(PageChannel.java:117)
at com.healthmarketscience.jackcess.impl.DatabaseImpl.<init>(DatabaseImpl.java:524)
at com.healthmarketscience.jackcess.impl.DatabaseImpl.open(DatabaseImpl.java:393)
at com.healthmarketscience.jackcess.DatabaseBuilder.open(DatabaseBuilder.java:252)
at com.healthmarketscience.jackcess.DatabaseBuilder.open(DatabaseBuilder.java:291)
You are trying to use the static
.open(file)
method on a new instance ofDatabaseBuilder
, and that does not seem to work with.setCodecProvider
. Try using.setFile(file)
and.open()
instead:Last edit: Gord Thompson 2016-12-03
Ah, good catch! i didn't notice that myself. you can also pass the file in the DatabaseBuilder constructor.