Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I connect a MS Access database to Jetbrains DataGrip

I have been using DataGrip for a couple of weeks now and I like it a lot. The only thing I am unable to find out is how to connect DataGrip to a MS Access database.

Could someone explain to me how to do that?

like image 356
Johan Vergeer Avatar asked Apr 24 '16 06:04

Johan Vergeer


2 Answers

For Future readers this is still very doable (I'm on DataGrip version 208.1.4):

Get UcanAccess

  1. Download and extract UcanAccess somewhere: pathToUcanAccess
  2. In Datagrip goto add new connection: "Driver And Data source"
    • this will create a connection "Database Driver -" and a Driver "Database Driver"
  3. Edit the newly created Driver "Database Driver":
    1. Under Additional Files add:
      • <pathToUcanAccess>\ucanaccess-4.0.4.jar
      • <pathToUcanAccess>\lib\commons-lang-2.6.jar
      • <pathToUcanAccess>\lib\commons-logging-1.1.3.jar
      • <pathToUcanAccess>\lib\hsqldb.jar
      • <pathToUcanAccess>\lib\jackcess-2.1.11.jar
    2. For Dialect select "SQL Driver"
    3. Hit Apply (this should load the classes from the added files)
    4. Under the class combo you should now see net.ucanaccess.jdbc.UcanaccessDriver, select it and hit apply again.
    5. Under Url templates add a new template, for name enter "default" for template enter jdbc:ucanaccess://{file::identifier.sqlite};newdatabaseversion=V2010
    6. Hit apply.
  4. Now edit the database connection "Database Driver -":
    1. Next to the text box for url, in the drop down select default (or what ever you named the template in step 3.5)
      • A file select field should replace the previously visible "user" and "password" fields
    2. In the file selector, select your mdb
      • the url field should now look like jdbc:ucanaccess://C:/data/MDBs/myMdbFile.mdb;newdatabaseversion=V2010
    3. Hit apply and then ok.

You should see your Connection popup in the list, double-click to connect, expand it down the tree ("Public \ <unnamed> \ tables") and you should see your tables.

Inspired by this question.

like image 85
GHayes Avatar answered Sep 20 '22 23:09

GHayes


You can try configuring MS Access as an ODBC source and then use a JDBC ODBC driver to connect to it, just like any other JDBC database.

like image 37
Musaad Haider Avatar answered Sep 20 '22 23:09

Musaad Haider