Setting up access to a database via Windows ODBC



  • Before you can use JAVA/SQL to access an MS Access database you need to setup a data souce name (DSN). 
  • Open your control panel (usually found under My Computer)
  • Start the ODBC program from the control panel (some versions of windows have an administrative tools section on the control panel, open that then select the ODBC program).
  • Select the User DSN tab and press the Add button

Important Note:

If you are running Windows 7, then you may have trouble setting up the Data Source Name through the control panel.  The ODBC tool in the control panel only lists 64 bit drivers, right now that includes only SQL Server, not MDB and ACCDB. To get around this, don't use the ODBC tool in the control panel, instead, run the following program:

C:\Windows\SysWOW64\odbcad32.exe

If you have never installed MS Access, then you'll need to download and install the drivers from microsoft.  Following the link below. Note, this will give you the 32 bit drivers which will work with 32 bit applications. 

Click here to download the drivers***(I've updated this link)



 
 
 
  • Select the database driver for your connection (Microsoft Access Driver) and click on the Finish button (your not really done yet).

 
 
 
 
 
  • Type in your data source name, then press the Select button to locate the database on your harddrive.

 
  • Finally press the Ok button.
  • The ODBC tool can also be used to set a user name and password to restrict access to your database. (click on the Advanced button to do this)
  • Important : The data source name you enter here is the one your program will use to connect to the database.