Menu

File marked as read only. Notice that only one process (one VM) for time can access in writing mode. on Win XP

Help
2015-04-23
2015-04-27
  • Caio César Silva

    Hi,

    I have a application for search the person on database and if not find, insert.

    The Java Version is 8.45

    the application don't have error, But When will insert happen the error :

    class net.ucanaccess.jdbc.UcanaccessSQLException
    File marked as read only . Notice que only one process ( one VM ) is team can access in writing mode .
    net.ucanaccess.jdbc.UcanaccessPreparedStatement.execute ( UcanaccessPreparedStatement.java:235 )

    anyone can help me ?

    PS: Sorry my english horrible :)

    I Try execute the same application on MAC OSX and i have the same error.

     

    Last edit: Caio César Silva 2015-04-23
  • Marco Amadei

    Marco Amadei - 2015-04-24

    That may happen if you're accessing to a access 97 format, which is supported in read-only.

     
  • Gord Thompson

    Gord Thompson - 2015-04-24

    You can use the following code to check the file format version:

    String dbFileSpec = "C:/Users/Public/test/sample.mdb";
    try (FileInputStream fis = new FileInputStream(dbFileSpec)) {
        String fmt = "(unknown)";
        byte[] bytes = new byte[21];
        fis.read(bytes, 0, 21);
        switch (bytes[20]) {
            case 0x0:
                fmt = "Jet 3.0 (Access 97)";
                break;
            case 0x1:
                fmt = "Jet 4.0 (Access 2000/2003)";
                break;
            case 0x2:
                fmt = "ACE 12.0 (Access 2007)";
                break;
            case 0x3:
                fmt = "ACE 14.0 (Access 2010)";
                break;
        }
        System.out.println("File format: " + fmt);
    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    
     
    • Caio César Silva

      Jet 3.0 (Access 97) :(
      Have no way to access the database in this format?

       
  • Caio César Silva

    Jet 3.0 (Access 97) :(

    Have no way to access the database in this format?

     
  • Marco Amadei

    Marco Amadei - 2015-04-24

    Unfortunately not: jackcess and, as consequence, ucanaccess do support this format in read-only. A conversion to a more updated version(even 2000 works fine) may solve your issue.

     

    Last edit: Marco Amadei 2015-04-24
    • Terry Peterson

      Terry Peterson - 2015-04-25

      For the benefit of the next person who stumbles upon this problem, would it be possible for you to change the wording of that error message to be more helpful than saying that the file is "read only"? The OS says it is not read only, so the error message leads to a lot of tail chasing (spoken by one who has severely bitten his tail on this very problem). E.g., it could say something about Access97 files not being writeable.

      Thanks.

       
  • Marco Amadei

    Marco Amadei - 2015-04-27

    Yes, this seems to be a common concern. I'll write down a specific message for ACCESS 97.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.