I have been creating a connection to a Microsoft Access database with '"jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + filepath' for years. It is very convenient because the users of the program don't have to create a DSN and I am using a Microsoft Access database because I just distribute a single file. My code is:
The code stopped working when I started to use 64 bit
Java. I am getting the exception message "[ODBC Driver Manager] Data source name not found and no default driver specified". After searching in the internet I found that there are 32 and 64 bit drivers; Windows keeps 32 bit drivers in Windows 32 in SysWOW64. The problem is I want to distribute this program and it is not known if the users will be using a 32 bit or a 64 bit machine. I would need to specify in Java which driver to use or ask the customers to run some script to force the use of a specific driver; I haven't been able to find out how to do this.