Menu

Column.getProperties() error on encrypted MS Access .mdb file

Guillaume
2013-08-13
2013-08-14
  • Guillaume

    Guillaume - 2013-08-13

    Hi,

    I'm trying to read an encrypted .mdb file which has a .mdw security.

    Under Windows with MS Access office, I can achieve this while doing "C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE" /wrkgrp "C:\DBSecurity.mdw" "C:\DB.mdb".

    With jackcess-1.2.14 and jackcess-encrypt-1.0.4, if I do :

            File fl = new File("C:\DB.mdb");
            Database db = Database.open(fl, false, false, null, null, new CryptCodecProvider(""));
            Set<String> tableNames = db.getTableNames();
            for (String tableName : tableNames) {
                System.out.println(tableName);
                Table tb = db.getTable(tableName);
                List<Column> lc = tb.getColumns();
                try {
                    for (Column cl : lc) {
                        System.out.println(cl.getName());
                        System.out.println(cl.getProperties());
                    }
                } catch (Exception e) {
                    System.out.println("Error occurred reading " + tb.getName()
                            + " column properties ");
                    e.printStackTrace();
                    throw e;
                }
            }
    

    I'm able to connect and retrieve table / column names but not column properties.
    I get the following error message :

    java.io.IOException: Unknown property block type 2
    at com.healthmarketscience.jackcess.PropertyMaps$Handler.read(PropertyMaps.java:183)
    at com.healthmarketscience.jackcess.Database.readProperties(Database.java:1277)
    at com.healthmarketscience.jackcess.Database.getPropertiesForObject(Database.java:1736)
    at com.healthmarketscience.jackcess.Table.getPropertyMaps(Table.java:421)
    at com.healthmarketscience.jackcess.Column.getProperties(Column.java:737)

    Do you have any idea if I'm missing something or if that could be a bug from Jackcess?

    Thanks a lot for your help.

    Guillaume.

     
    • James Ahlborn

      James Ahlborn - 2013-08-13

      if you are able to read tables and columns, then the problem is most likely not encryption related. it's probably just a property format that jackcess does not yet handle. it would be great if you could file a bug in the jackcess project and attache a database which exhibits the problem (it's tough to solve these kinds of problems without actual data).

       
  • Guillaume

    Guillaume - 2013-08-14

    Thanks James, I've just opened a bug for this here : https://sourceforge.net/p/jackcess/bugs/96/

     

Log in to post a comment.

MongoDB Logo MongoDB