[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Hi there,
i've got a problem to connect me with the odbc driver manager in my java application. I get the following Exception, while connection to the database: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
On my system, i have a 64 bit OS (Windows Server Edition 2008), a 64 Bit JVM and Access 2010, also 64 Bit.
The ODBC-Driver is also installed correctly in the driver manager as 64 Bit version.
In my Java Application, I try to start a connection with the following lines of code:
Driver d = (Driver)Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
Connection c = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=c:/tech97.mdb");
Here, I get the called Exception.
But I really don't know why. I also tried to install the 64Bit version of the
"Microsoft Access Database Engine 2010 Redistributable" http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=13255 , but it didn't work out either.
The problem was the connection string! The right connection string was:
DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=c:/tech97.mdb")
I forgot the part with "*.accdb".
Regards,
Martin
24 people found this reply helpful
·
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.