View Single Post
insinkerator

 
Member Since: Jul 22, 2008
Posts: 59
insinkerator is an unknown at this point

insinkerator is offline
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:


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?
QUOTE Thanks