Is there a way to connect an SQL client to query an MS Access database?
For example, with a Java-based SQL client like SQuirreL SQL, use a JDBC connection to query tables in an .accdb file.
Use case:
Complex SQL queries with multiple subqueries that are incompatible with the Query Designer UI.
Reason for wanting to use an SQL client:
Using an SQL client would be much easier than writing SQL in the Access SQL window.
The Access SQL window is extremely limited:
- The text is small/hard to read and not mono-spaced
- There isn't any linting functionality, autocorrect, etc.
- The SQL spacing gets lost when you close a query and reopen it.
- No find & replace functionality.
- Many more limitations.
So, I'm hoping to find a way to connect an SQL client like SQuirrel to the Access database instead.

It looks like the answer is yes.
In SQuirreL, I used a JDBC product called CDATA Access JDBC Driver: https://www.cdata.com/drivers/access/jdbc/download/.
jdbc:access. Use a full URL instead:jdbc:access:DataSource=C:/MyDB.accdb;.Result:
I'm able to query my local .accdb MS Access database using the SQuirreL SQL client.
Note about SQL syntax:
The syntax seems to be generic SQL, such as SQL-92 or something like that. It doesn't use native MS Access syntax.
For example, this would work directly in MS Access:
But in SQuirrel, the asterisk
*wildcard isn't supported. Neither is the UCASE function. Instead, the percent symbol%wildcard is used. And UPPER is used instead of UCASE.Edit:
It looks like RazorSQL might be another option (free trial; paid):
And I suppose other SQL clients that support ODBC might be an option too, such as Toad Data Point.
Or use SQL Server Management Studio: https://superuser.com/questions/51777/connect-to-an-ms-access-database-from-sql-management-studio. Although, I wasn't able to get that working.