java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'people'. Make sure it exists and that its name is spelled correctly. at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958) at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115) at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3111) at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338) at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:253) at dataTest.People2.main(People2.java:55) Exception in thread "main"

Well, first the obvious question I have to ask since you didn't say one way or another. Are you sure there is a table called 'people' in the database? And is it the same case? Not People or PEOPLE?

Mark Patrick

Ranch Hand

Posts: 51

posted 12 years ago

You're getting a connection to the Access database without a problem. The error message is stating the Access cannot find a table or query in your database called 'people'. Are you sure that the table in the database is called 'people'?

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958) at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115) at sun.jdbc.odbc.JdbcOdbc.SQLGetDataInteger(JdbcOdbc.java:3812) at sun.jdbc.odbc.JdbcOdbcResultSet.getDataInteger(JdbcOdbcResultSet.java:5642) at sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcResultSet.java:585) at sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcResultSet.java:603) at dataTest.People2.main(People2.java:58) Exception in thread "main"

--sorry about that

Julian Kennedy

Ranch Hand

Posts: 823

posted 12 years ago

Hi Chris,

Slightly counter-intuitively you have to call myResultSet.next() before you can get the values from the first row with your getInt() and getString() calls. If you move the gets inside your while loop it should work fine.

Jules

chris le

Greenhorn

Posts: 15

posted 12 years ago

Thanks for responding!

Two questions:

1. Could you post a code sample? (still very new, and would like to compare with what I have)

2. It sounds like doing it that way will not allow me to set the variables to the result values and then print out values of the variables. Is this true?

Thank you all for your help!

Take care,

Chris

Julian Kennedy

Ranch Hand

Posts: 823

posted 12 years ago

I obviously didn't explain it very well. Here's the code snippet showing what I mean:

That's what I mean by moving the gets inside the while loop (remove them from where they currently are). Is that clear now?