Hi,
I\'m trying to insert a record to a test database and getting the following exception:
java.lang.UnsupportedOperationException: should not be called
at com.healthmarketscience.jackcess.IndexData$ReadOnlyColumnDescriptor.writeNonNullValue(Unknown Source)
at com.healthmarketscience.jackcess.IndexData$ColumnDescriptor.writeValue(Unknown Source)
at com.healthmarketscience.jackcess.IndexData.createEntryBytes(Unknown Source)
at com.healthmarketscience.jackcess.IndexData.addRow(Unknown Source)
at com.healthmarketscience.jackcess.Table.addRows(Unknown Source)
at com.healthmarketscience.jackcess.Table.addRow(Unknown Source)
Here is my code:
Database db = Database.open(new File(\"mdbfiles/test.mdb\"));
Table t = db.getTable(\"TEST\");
Object[] objs = new Object[7];
objs[0] = \"test\";
objs[1] = \"te\";
objs[2] = null;
objs[3] = null;
objs[4] = null;
objs[5] = null;
objs[6] = null;
t.addRow(objs);
db.close();
the test MDB file is attached as well (in Zip)
what am I doing wrong?
the text sort order on you text columns is not the "general" order, it is the chinese order (2052). jackcess only supports updating indexes with the "general" sort order.
if you enabled the logging, you should have seen a message like:
Unsupported collating sort order 2052(0) for text index, making read-only
Hi James, I have faced the same problem - I was not able to add rows into the table which has some text fields indexed.
Is there a way how to change that text sort order (ie collating sort order)? Either programatically, or even by hand in ms access it would be sufficient.
I have found just the option to turn the indexing of, but I haven't found how to change the collation.
Thanks!
there's no way to change the sort order through jackcess.
i believe you can do it through ms access by setting the default sort order in access to the general sort order and then running "compact and repair" on your database.