I'm trying to access a Microsoft Access database using the following code:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ="+ dbpatch + "/SilverDB.accdb";
Connection conn = DriverManager.getConnection(database, "", "");
Statement s = conn.createStatement();
The problem is that when I run it through Eclipse, everything goes fine, but when I generate the executable jar and then run it, it doesn't work. Does anyone knows the reason?
Thanks!