- Joined
- Jul 22, 2008
- Messages
- 59
- Reaction score
- 0
- Points
- 6
I have a Java project that reads and writes to a database for college, it's programmed in jGrasp, and it connects to a MS access database. It works on our W7 computers in college, but when I try to execute the same code on my Windows partition I get this error:
SQL Exception: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0xc94 Thread 0xbac DBC 0x71b800
For what it's worth, this is the connection code:
Any ideas?
SQL Exception: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0xc94 Thread 0xbac DBC 0x71b800
For what it's worth, this is the connection code:
Code:
try { //try catch block for accessing database
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:Driver={Microsoft Access Driver " +
"(*.mdb, *.accdb)};DBQ=C:\\Users\\Killian\\Desktop\\Java Project 2";
Connection con = DriverManager.getConnection(url);
Statement stmt = null;
ResultSet rs = null;
// SQL query command
String SQL = "SELECT * FROM tblEmployee";
stmt = con.createStatement();
rs = stmt.executeQuery(SQL);
while (rs.next()) {
username = (rs.getString("Username")); //assigns username value from table
password = (rs.getString("Password")); //assigns password value from table
}
con.close();
}
catch (SQLException e)
{
System.out.println("SQL Exception: "+ e.toString());
}
catch (ClassNotFoundException cE) {
System.out.println("Class Not Found Exception: "+
cE.toString());
}
Any ideas?