Menu

#96 Column.getProperties() error on MS Access .mdb file

1.2.14.2
closed
nobody
None
1
2014-09-29
2013-08-14
Guillaume
No

Hi,

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

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)

My .mdb file (see attached) might contain an unsupported property format?

Thanks a lot for your help, you're doing a great job with this library.

Guillaume.

1 Attachments

Discussion

  • James Ahlborn

    James Ahlborn - 2013-08-14
    • Group: 1.2.14.1 --> Unassigned
     
  • James Ahlborn

    James Ahlborn - 2013-08-15
    • Group: Unassigned --> 1.2.14.2
     
  • James Ahlborn

    James Ahlborn - 2013-08-16
    • status: open --> closed
     
  • James Ahlborn

    James Ahlborn - 2013-08-16

    this is fixed in the 1.2.14 branch and in trunk and will be in the 1.2.14.2 and 2.0.0 releases.

     
  • James Ahlborn

    James Ahlborn - 2013-08-16

    btw, the test file isn't encrypted, you don't need to use jackcess-encrypt for that file.

     

Log in to post a comment.