Search code examples
sql-serverms-accessjdbcjtds

Is possible to use JDBC to connect MS Access to SQL Server?


I already do the connection using ODBC, but I'm having some slowness issues, I find out the jTDS, they say that is the fastest JDBC, so I'm trying to use it in my project, but without sucess, someone know how to use jTDS to connect MS Access Front-End to SQL Server Back-end?

Here's my code using ODBC, it is inside a loop:

DoCmd.TransferDatabase _
            acLink, _
            "ODBC Database", _
            "ODBC;Driver={SQL Server};Server=" & vIP & ";Database=" & vDb & "; UID=" & vUser & "; PWD=" & vPwd & "; ", _
            acTable, _
            rstSchema!table_name, _
            rstSchema!table_name, , True

Solution

  • Short Answer: NO You can not use JDBC driver for MSSQL frontend.

    Long Answer: JDBC driver enables java based application connect to SQL Server. So for different databases different JDBC drivers are available.

    Unfortunately JDBC having different requirements and will not fit in stack what you are using. For MS Access Frontend ODBC is a natural choice.

    You can think of consuming microservices. But this will be overkill for MS Access front end.

    Instead think of how you can tune queries or can use some server side cursor / procedures depend on your scenario.