Ok,
I'm having trouble getting my java program to connect to the new .accdb MS Access 2007 database file. I downloaded the new data connectivity tool for Office 2007 and I'm still getting [Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt.
Here's the code I'm using to connect
String filename = dbFile.getPath();
String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=";
database+= filename.trim() + ";DriverID=22;READONLY=false}"; // add on to the end
// now we can get the connection from the DriverManager
Connection con = DriverManager.getConnection(database);
Statement s = con.createStatement();
Can anyone tell me what I need to do to get this piece of code to connect to a 2007 Access database file? By the way, this works perfect with a 2003 Access database file (.mdb). Thanks!