2

I am writing a Java application that creates some data for the user and needs to generate an Access file that the user can then download and open with MS Access. The user has MS Access 2013.

The only Java library I found online is Jackcess. However, in their documentation and in their API as well they only go up to V2010.

Will the file generated with File Format V2010 be opened by Access 2013? Based on research so far - no.

Are there any other solutions that will allow a Java program to create an Access 2013 file? Please, share! All help with Java + Access 2013 out there is for connecting to an Access 2013 database. I don't need to connect, I just need to create a file that the user will import.

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
elanamig
  • 359
  • 3
  • 6
  • 14
  • So give it a try and you will see it it works. – vanje Nov 25 '14 at 22:05
  • Wanted to get a head start while waiting for the Access 2013 installation... – elanamig Nov 28 '14 at 19:30
  • Thanks. Changing content type didn't help. And I separated the follow up into it's own question http://stackoverflow.com/questions/27196153/jackcess-mdb-file-corrupted-during-servlet-write-to-the-client – elanamig Nov 28 '14 at 21:33
  • Use `byteRead = fis.read(buffer)`. You forgot to fill the buffer. You used the `read()` version to read byte by byte without a buffer. – vanje Nov 28 '14 at 21:36
  • Thank you, vanje, you're right. I was staring at it for hours and didn't see it. I upvoted your answer in the other thread. – elanamig Nov 28 '14 at 22:12
  • FYI there is not really any such thing as a "2013" database. Access 2013 generates a database with the same format as Access 2010. – jtahlborn Dec 07 '14 at 02:14

1 Answers1

3

Yes, an Access_2010-format file (FileFormat.V2010) created by Jackcess can be opened in Access 2013. Jackcess can also manipulate an .accdb file created by Access 2013. I have done both of those tasks and they worked fine for me.

If you haven't done so already you might consider using UCanAccess. It uses Jackcess to do the actual reading and writing of the Access database file, but UCanAccess is a (pure Java) JDBC driver so you can use SQL instead of having to write directly to the Jackcess API. For more information, see

Manipulating an Access database from Java without ODBC

Community
  • 1
  • 1
Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
  • Thanks! I have good news and bad news. The good news is that I can create a 2010 mdb file on the server side, and when this file is FTP'd to the client, Access 2013 on the client side can open it. The bad news, is that I need to transfer this file through the servlet, and when that is done, Access cannot open it. So FTP'ing works, but servlet transfer does not. I'm updating the original message with the upload code. Thank you! – elanamig Nov 28 '14 at 19:22