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.
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)
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)
Hmmm. I can't tell if the attachments are coming thru correctly.
Here they are:
MIST-test - original.mpddb (uncorrupted)
https://dl.dropboxusercontent.com/u/635893/MIST-test%20-%20original.mpddb
MIST-test.mpddb (corrupted)
https://dl.dropboxusercontent.com/u/635893/MIST-test.mpddb
Last edit: Tom H 2013-04-28
"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.
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.