Menu

#94 Error when memo field contains more than 1024 characters

1.2.12
closed
None
1
2013-05-11
2013-04-27
Tom H
No

I've run into a bug when trying to add a memo field of greater than 1024 characters. Jacksess doesn't throw an error, but when viewing the data in Access, the field says #ERROR and clicking on it produces this following message:

"Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt."

Unfortunately this is a fatal bug for my project, as I often need to provide memo fields longer than that.

PS: Sorry if I didn't fill out this trouble ticket properly; I'm not used to the SF ticketing system.

Discussion

  • James Ahlborn

    James Ahlborn - 2013-04-27

    are you creating a database from scratch? if so, can you include some example code? if you are using an existing db, can you attach the broken db and possibly the code you are using to update it?

    (note, i've tested memos up to 2GB and i believe the unit tests test some very large memo values)

     
    • Tom H

      Tom H - 2013-04-28

      James,

      Thanks for your help with this. No, I'm not creating the database from scratch. I'm using it to connect to a legacy database (so yeah, there could already be problems there, I suppose.) Continued testing results in that #ERROR thing I mentioned above.

      I also created an empty version of the database using the legacy software's interface. I then added just a little sample data. When I try running the following code on the test, it doesn't always give that #ERROR problem, but instead it sometimes turns the text into a small number of pound signs ("#############"). Weird!

      Map<string, object=""> historyRow = new HashMap<string, object="">();
      historyRow.put("HistoryID", 12345); // Matches HistoryID below
      historyRow.put("LastEdit", new Date());
      historyRow.put("AppealID", null);
      historyRow.put("TaskTypeID", 100);
      historyRow.put("Description", "My description");
      historyRow.put("HistoryDate", new Date());
      historyRow.put("Notes", StringUtils.repeat("1234567890", 300)); // Problem line
      historyRow.put("HistoryResultID", 1);</string,></string,>

      Map<string, object=""> historyContactRow = new HashMap<string, object="">();
      historyContactRow.put("HistoryContactID", 10000);
      historyContactRow.put("LastEdit", new Date());
      historyContactRow.put("HistoryID", 12345); // Matches HistoryID above
      historyContactRow.put("ContactID", 1800450568); // From the Contacts table</string,></string,>

      try {
      Table historyTable = db.getTable("History");
      historyTable.addRow(historyTable.asRow(historyRow));
      Table historyContactTable = db.getTable("HistoryContact");
      historyContactTable.addRow(historyContactTable.asRow(historyContactRow));
      } catch (IOException e) {
      }

      Attachments: (password is 'tntMPD' on both)

      • MIST-test - original.mpddb - uncorrupted, before I ran the following sample code
      • MIST-test.mpddb (corrupted DB, with #ERROR msg)
       
  • James Ahlborn

    James Ahlborn - 2013-05-02

    "good" news, i can recreate the error on a "clean" database. i thought it might be something weird happening in your custom database, but it appears to be something in jackcess alone.

     
  • James Ahlborn

    James Ahlborn - 2013-05-03

    Apparently access doesn't like unicode compressed strings longer than 1024 chars.

    This is fixed in the trunk and will be in the 1.2.11 release.

     
  • James Ahlborn

    James Ahlborn - 2013-05-03
    • status: open --> closed
    • assigned_to: James Ahlborn
    • Group: 1.2.9 --> 1.2.11
     

Log in to post a comment.

MongoDB Logo MongoDB