Harry Duong
Harry Duong

Reputation: 427

How to configure Squirrel SQL client to work with MS Access

I'm struggling to get Squirrel SQL to connect to MS Access database (just a normal one, no password):

I guest this should be a simple straight forward process, but please advise me how to get it working.

Upvotes: 9

Views: 10235

Answers (2)

Gord Thompson
Gord Thompson

Reputation: 123409

Now that the JDBC-ODBC Bridge has been removed from Java 8 the previous answer to this question will become less relevant over time. The following method uses the UCanAccess JDBC driver.

Go to UCanAccess on Maven Central, Browse the latest version, and download the uber.jar file.

Creating a Squirrel SQL "Driver" entry (one-time setup)

In Squirrel SQL, create a new "Driver" entry for UCanAccess and specify the location of the uber.jar on the "JDBC Driver Class Path" pane

squirrel_driver

Note: Remember to enter net.ucanaccess.jdbc.UcanaccessDriver as the "Class Name" (see above).

Creating a database "Alias" (one for each database)

To open a specific database, create a Squirrel SQL "Alias" entry, replacing the <path_to_database_file> placeholder with the actual path to the file

squirrel_alias

Important: Make sure that the connection URL ends with ;showSchema=true.

Upvotes: 10

Harry Duong
Harry Duong

Reputation: 427

I found the solution. Put below string in URL:

(Assuming that path to your database file is D:\DBs\DatabaseFile.mdb)

jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=D:\DBs\DatabaseFile.mdb

Upvotes: 2

Related Questions