Menu

#151 Column getLengthInUnits half of actual length for Access_97 TEXT columns

2.2.2
closed
nobody
None
1
2019-01-05
2018-12-29
No

When processing an Access_97 file, Column#getLengthInUnits is half of the actual maximum length for TEXT columns. For the attached sample .mdb file

System.out.println(db.getFileFormat());

Table tbl = db.getTable("Table1");
for (Column col : tbl.getColumns()) {
    System.out.printf("%s\t%s(Length: %d, LengthInUnits: %d)%n", 
            col.getName(), col.getType(), 
            col.getLength(), col.getLengthInUnits());
}

produces

V1997 [VERSION_3]
text50  TEXT(Length: 50, LengthInUnits: 25)

Access_97 does not store TEXT columns as Unicode, so the lengths should be the same (50 in this case).

1 Attachments

Discussion

  • James Ahlborn

    James Ahlborn - 2018-12-29

    just curious, what charset are you using for the db?

     
    • Gord Thompson

      Gord Thompson - 2018-12-29

      Default for an Office_97 install on Win2K with "English (United States)" as the locale. Probably Windows-1252, and I just verified that € is stored as 0x80, which seems to confirm that.

       
  • James Ahlborn

    James Ahlborn - 2018-12-29

    I'm curious why you need this to work since 97 is a read only format?

     
  • James Ahlborn

    James Ahlborn - 2018-12-31
    • status: open --> closed
    • Group: Unassigned --> 2.2.1
     
  • Luis Esparza

    Luis Esparza - 2019-01-04

    Thank you very much to both, I'm the OP from Stack Overflow. Your hard work inspires me, I will find a way to give back to the community. Thanks!

     
  • James Ahlborn

    James Ahlborn - 2019-01-05
    • Group: 2.2.1 --> 2.2.2
     
  • James Ahlborn

    James Ahlborn - 2019-01-05

    Unfortunately, i accidentally mislabeled this bug. It did not make the 2.2.1 release. it will be in the 2.2.2 release.

     
  • Luis Esparza

    Luis Esparza - 2019-01-05

    Working like a charm, thank you!

     

Log in to post a comment.

MongoDB Logo MongoDB