Connecting Microsoft Access with Java

Contents

Introduction

To connect Java with Microsoft Access, you need a JDBC driver. Although Microsoft do not produce a JDBC driver for Microsoft Access, Easysoft provide two Microsoft Access JDBC drivers. Use these JDBC drivers to provide the connectivity layer between your Java code and Microsoft Access database.

Prerequisites

Configuring the Microsoft Access ODBC data source

In the Windows ODBC Data Source Administrator, choose the System DSN tab, and then choose Add.

Give your data source a meaningful name and then choose Select. Browse to your .mdb file.

Once you've chosen the database, use the OK buttons to exit the dialog box. You've now created your data source.

You can now work with your Access data in applications such as:

Common problems

Why can't I connect to my Microsoft Access database using the Easysoft JDBC-ODBC Bridge?

The problem is likely to be that the Microsoft Access .mdb file is on a mapped network drive that can only be accessed by a named user.

There are three possible solutions:

Why do I get the error "Client denied access due to access control rule"?

The machine you're running the JDBC-ODBC Bridge JDBC client on has attempted to connect to the specified JDBC-ODBC Bridge server, but there is an access control rule on the server machine that denies your client access. You need to use the JDBC-ODBC Bridge web administration interface to examine the access control rules. Point a web browser at:

http://myserver:8031

Then choose Security. The access control rules are defined on this page.