Menu

#86 \"should not be called\" exception

closed
nobody
None
5
2014-10-20
2011-11-04
jprog2011
No

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?

Discussion

  • jprog2011

    jprog2011 - 2011-11-04
     
  • James Ahlborn

    James Ahlborn - 2011-11-04

    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

     
  • Ondrej Stuchlik

    Ondrej Stuchlik - 2013-04-29

    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!

     
    • James Ahlborn

      James Ahlborn - 2013-04-30

      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.

       

Log in to post a comment.